Q:
How to get the object represented by a node in the Inventor Part Browser Tree?
A:
The BrowserNodeDefinitions in the Inventor native browsers are actually 'NativeBrowserNodeDefinition' objects and therefore provide some additional functionality. You can get information from them about the native object they represent (e.g. A Part Feature).
The following VB.Net code snippet illustrates this:
Sub BrowserTest(ByVal app As Inventor.Application)
Try
Dim doc As PartDocument
doc = app.ActiveDocument
Dim pane As BrowserPane
pane = doc.BrowserPanes("Model")
Dim nodeDef As NativeBrowserNodeDefinition
nodeDef = pane.TopNode.BrowserNodes(1).BrowserNodeDefinition
'if this BrowserNode is only a folder, this would give error
Dim obj As Object
obj = nodeDef.NativeObject
Debug.Print(TypeName(obj))
Catch ex As Exception
End Try
End Sub