- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'd like to know how can I get textual names for types of Browser Nodes presented in Part's browser (Model Tab).
When I add "ToString" after the Type query I still get numeric value like:
The iLogic code I'm using is:
Dim oIPT As PartDocument=ThisDoc.Document
Dim MsgBody As String
For Each oNode In oIPT.BrowserPanes("PmDefault").TopNode.BrowserNodes
If oNode.Visible Then
MsgBody &= oNode.BrowserNodeDefinition.Label & vbCrLf
If Not oNode.NativeObject Is Nothing Then
MsgBody &= " Type : " & oNode.NativeObject.Type.ToString & vbCrLf
End If
End If
Next
MsgBox (MsgBody,,"Node types are:")
Exit SubThe issue described was reproduced in Inventor 2020.2.1
Please vote for Inventor-Idea Text Search within Option Names
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Are you looking for something like this? ![]()
Sub Main Dim oIPT As PartDocument = ThisDoc.Document Dim MsgBody As String For Each oNode In oIPT.BrowserPanes("PmDefault").TopNode.BrowserNodes If oNode.Visible Then MsgBody &= oNode.BrowserNodeDefinition.Label & vbCrLf If Not oNode.NativeObject Is Nothing Then MsgBody &= " Type : " & GetObjectEnum(oNode.NativeObject.Type.ToString) & vbCrLf End If End If Next MsgBox(MsgBody, , "Node types are:") Exit Sub End Sub Function GetObjectEnum(oValue) Dim oEnumType As EnumType oEnumType = ThisApplication.TestManager.GetEnumType("ObjectTypeEnum") oEnumType.Value = 0 Dim oName As String Dim index As Integer index = 0 Do While index < oEnumType.Count If oEnumType.Value = oValue oName = oEnumType.ValueName Exit Do End If oEnumType.MoveNext index = index + 1 Loop Return oName End Function
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thank for the suggestion, but I also got the single-line solution (https://forums.autodesk.com/t5/inventor-customization/api-return-enumerator-name-instead-of-numeric-...).
InstedOf:
oNode.NativeObject.Type.ToString
The
[Enum].GetName(GetType(ObjectTypeEnum), oNode.NativeObject.Type)
...should be used.
Please vote for Inventor-Idea Text Search within Option Names