Hi,
I'm using Inventor 2013 and VB 2010 Express... I can find a part or sub from browser and open it seperately by below code:
Dim invDocs As AssemblyDocument
invDocs = Form1.inv_App.ActiveDocument
Dim invDocument As Document
Dim Sayac As Integer
Dim oRefDocs As DocumentsEnumerator
oRefDocs = invDocs.AllReferencedDocuments
Dim invDocument2 As Documents
invDocument2 = Form1.inv_App.Documents
For Each invDocument In oRefDocs
If Form1.BaseFilename(invDocument.FullDocumentName).ToUpper = TextAranan.Text Then invDocument2.Open(invDocument.FullDocumentName, True)
Sayac += 1
Next
But I need to make the part selected on the browser? I want to focus (highlight) on the part and reposition the browser tree?
Is this possible from API?...
Regards,
Mucip:)
Hi,
get the active BrowserPane, next BrowserPane.GetBrowserNodeFromObject to get the browser node that corresponds to the input object. Finally, call BrowserNode.DoSelect
Hi,
First of all thanks a lot for your kind interest...
I couldn't understand very well. Please could you explain little bit more detailed?...
Regards,
Mucip:)
Hi,
I found something after than your guidence e-mail.
Below code is working good but only for the first level of the tree. I need to iterate/search all levels of the assembly tree.
How can I do that?...
Dim invDocs As AssemblyDocument
invDocs = Form1.inv_App.ActiveDocument
Dim bp As BrowserPane
Dim nodes1 As BrowserNodesEnumerator
bp = invDocs.BrowserPanes("Model")
nodes1 = bp.TopNode.BrowserNodes
Dim node As BrowserNode
For Each node In nodes1
If node.BrowserNodeDefinition.Label.Split(":")(0) = TextSearchFileName.Text Then
node.DoSelect()
Exit For
End If
Next
Regards,
Mucip:)