Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Rule WriteItemNumber As String Dim InventorApplication = Autodesk.Intent.IntentAPI.Instance.HostAPI.HostApplication Dim RootPart = InventorApplication.ActiveDocument 'GetHostObject(root) Dim oBom = RootPart.ComponentDefinition.BOM 'Dim oBOMView = oBom.BOMViews[1] '<---That doesn't work Dim oBOMView = oBom.BOMViews.Item("Structured") '<---That doesn't work too Dim i As Integer = 0 oBOM.StructuredViewEnabled = True oBOM.StructuredViewFirstLevelOnly = False oBOM.PartsOnlyViewEnabled = False For Each oBomRow In oBOMView.BOMRows oBomRow.ItemNumber = "Test" i=i+1 Next Return Format("%d ItemNumbers are changed",i) End Rule
I try to modify the Inventor BOM ItemNumber from Intent rules via API. The attached code doesn't work.
Is it possible to do it in this way?
Dieter
Solved! Go to Solution.
Reply
Reply