Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to write some code that will get the current names of the Origin work features. In order to do that, I need to access the origin folder. I'm close, but the code I have isn't working -- I think because it's meant to access Assembly folders, and the Origin folder is a special folder that isn't contained in this "set" (plus I'm in a Part which can't have folders).
Below is what I have. I need help with the lines in red: The one that accesses the Origin folder, which isn't working, as well as the lines that check if the node being checked is a Work Plane, Work Axis, or Work Point, since Inventor doesn't seem to like those either.
Dim oPlaneNames(3) As String Dim oAxisNames(3) As String Dim oCenterPointName As String oPane = ThisApplication.ActiveDocument.BrowserPanes.Item("Model") oOriginFolder = oPane.TopNode.BrowserFolders.Item("Origin") oOriginFolderNodes = oOriginFolder.BrowserNode.BrowserNodes Dim PlaneCount As Integer = 0 Dim AxisCount As Integer = 0 For Each oNode As BrowserNode In oOriginFolderNodes oObject = oNode.NativeObject If oObject = WorkPlane Then PlaneCount = PlaneCount + 1 oPlaneNames(PlaneCount) = oObject.Name End If If oObject = WorkAxis Then AxisCount = AxisCount + 1 oAxisNames(AxisCount) = oObject.Name End If If oObject = WorkPoint Then oCenterPointName = oObject.Name End If Next
Thanks in advance!
Solved! Go to Solution.