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

Hi

 

Therefore:

 

Try this.

 

 

' Set a reference to the assembly document.
' This assumes an assembly document is active.
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

' Set a reference to the BOM
Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM
	oBOM.StructuredViewFirstLevelOnly = False
	oBOM.StructuredViewEnabled = True
	Dim oStructuredBOMView As BOMView
    oStructuredBOMView = oBOM.BOMViews.Item("Structured")
Call oStructuredBOMView.Sort("Stock Number",True)
Call oStructuredBOMView.Renumber(1, 1)
MessageBox.Show("Done", "Sort BOM")
Reg
2025.2