Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BOM renumber iLogic code almost done, need help.

1 REPLY 1
Reply
Message 1 of 2
DeerSpotter
947 Views, 1 Reply

BOM renumber iLogic code almost done, need help.

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) 

 

Image and video hosting by TinyPic
..........................................................................................................................
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
..........................................................................................................................


See My LinkedIn Profile
1 REPLY 1
Message 2 of 2
tsreagan
in reply to: DeerSpotter

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report