Community
i cant get the BOM to Renumber. See my code, for some reason it doesnt work. also if possible i would like for it to be renumbered by 001 not 1, and then sorted.
' Set a reference to the assembly document. ' This assumes an assembly document is active. Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Dim oBOM As BOM oBOM = oDoc.ComponentDefinition.BOM Dim oBOMView As BOMView oBOMView = oBOM.BOMViews.Item("Parts Only") ' Sort the BOM Call oBOMView.Sort("BOM Structure",True) ' Sort the BOM with a custom field Call oBOMView.Sort("TYPE",True) 'Call oBOMView.Sort("Part Number",True) 'This is the line that I want to use, but is inconsistent. Call oBOMView.Sort("BOM Structure",True ,"TYPE",True ,"Part Number",True) 'Re-Number the BOM Call oBOMView.Renumber(1, 1)
You will probably have to set up a loop to increment through the bom rows.
I have attached a BOM cylce routine, a few edits may get you closer to what you want.
T.S.