012 - 装配体BOM根据零件代号排序
2024-01-05 本文已影响0人
怪怪001
' 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 ' Display All levels
oBOM.StructuredViewEnabled = True
Dim oBOMView As BOMView
oBOMView = oBOM.BOMViews.Item(2)
' Set a reference to the "Parts Only" BOMView
Call oBOMView.Sort("Part Number", True)
Call oBOMView.Renumber(1, 1)