- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm try for read item number like a picture below and wanna get the data structure as per Structured View.
But I can't. Because the program read the ItemNumber as per Model data or Hierarchy in object history.
I wanna the data like this:
1
1.1
1.2
1.3
1.4
1.5
2
2.1
2.2
2.3
3
3.1
3.2
4
5
6
But I get actual data like this :
1
1.1
1.2
1.3
1.4
1.5
4
2
2.1
2.2
2.3
5
6
3
3.1
3.2
Here's the code :
Sub ListBomItems() Dim asm As AssemblyDocument asm = invApp.ActiveDocument Dim b As BOM b = asm.ComponentDefinition.BOM b.StructuredViewEnabled = True Dim bv As BOMView bv = b.BOMViews("Structured") Call ListItems(bv.BOMRows, 0) End Sub Sub ListItems(rows As BOMRowsEnumerator, indent As Integer) Dim row As BOMRow For Each row In rows Debug.Print(row.ItemNumber.ToString) If Not row.ChildRows Is Nothing Then Call ListItems(row.ChildRows, indent + 2) End If Next End Sub
Is there way for rearrange data structure in Model Data / Hierarchy model ?
Solved! Go to Solution.
Link copied