how do I get the iam files BOM Sortede?

how do I get the iam files BOM Sortede?

Darkforce_the_ilogic_guy
Advisor Advisor
297 Views
1 Reply
Message 1 of 2

how do I get the iam files BOM Sortede?

Darkforce_the_ilogic_guy
Advisor
Advisor

how do I get the iam files BOM Sortede?

 

' Gets the active document
Dim oDrawDoc  = ThisApplication.ActiveDocument
' Gets the active sheet parts list
Dim oPartList As PartsList = oDrawDoc.ActiveSheet.PartsLists.Item(1)
' Sorts parts list by PART NUMBER
oPartList.Sort("PART NUMBER")

' Renumbers the parts list
oPartList.Renumber()

 

this code sort patlist  on idw.  how do I do the same at iam files BOM ?

 

 

0 Likes
298 Views
1 Reply
Reply (1)
Message 2 of 2

daltonNYAW9
Advocate
Advocate

This should work

Dim oADoc As AssemblyDocument = ThisDoc.Document

Dim oBOM As BOM = oADoc.ComponentDefinition.BOM
oBOM.PartsOnlyViewEnabled = True

Dim oBOMView As BOMView = oBOM.BOMViews.Item("Parts Only")

oBOMView.Sort("Part Number")
oBOMView.Renumber()
0 Likes