Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Sub Main
Dim oAss as AssemblyDocument
oAss= ThisApplication.ActiveDocument Dim oBOM As BOM oBOM = oAss.ComponentDefinition.BOM oBOM.StructuredViewEnabled = True oBOM.StructuredViewFirstLevelOnly = False

Dim oBOMView as BOMView
oBOMView = oBOM.BOMViews.Item("Structured")

Dim oRow as BOMRow
For Each oRow in oBOMView.BOMRows
'do stuff
qty = oRow.ItemQuantity
Call RecurseBOMRow(oRow)
Next
End Sub

Sub RecurseBOMRow(oRow as BOMRow)
For Each oRow In oRow.ChildRows
'do stuff
qty = oRow.ItemQuantity
If Not oRow.ChildRows Is Nothing
Call RecurseBOMRow(oRow)
End If
Next
End Sub

I didn't quite understand what you were wanting but this is a simple version that goes through each row in the structured BOM, checks if it has child rows and goes through them, and gets the item quantity.