Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic Assy BOM sort by 3 columns

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
SoulAsasin
2070 Views, 6 Replies

iLogic Assy BOM sort by 3 columns

Hello all,

I know this has already been adressed, with no solution, but I am hoping that somebody will see this and maybe help me out.

 

I have an iLogic configurater Assembly with parts getting suppressed and activated. I got to the point, where I have my assembly, and i want to sort, renumber end export the BOM Structured view. I thought it will be a simple thing....

 

Look at the code I have now.

 

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oAssyDef As AssemblyComponentDefinition
oAssyDef = oDoc.ComponentDefinition

Dim repMgr As RepresentationsManager
repMgr = oAssyDef.RepresentationsManager

Dim oMasterLOD As LevelOfDetailRepresentation
oMasterLOD = repMgr.LevelOfDetailRepresentations.Item(1)
oMasterLOD.Activate
 
Dim oBOM As BOM
oBOM = oAssyDef.BOM
 
oBOM.StructuredViewEnabled = True

oBOMView = oBOM.BOMViews.Item("Structured")

oBOMView.Sort("BOM Structure",1,"Vendor",1,"Part Number",1)

oMasterLOD = repMgr.LevelOfDetailRepresentations.Item(5)
oMasterLOD.Activate
   
oDoc.Save

 

The problem is that it is not sorting based on 3 columns (BOM Structure, Vendor, Part Number). It is only sorthing based on the first criteria (BOM Structure), which is not enough for me.

 

Invento Programing help says it should work, but it dosn't.

 

Does anybody have  a solution for this?

 

Is this maybe working on the  drawing sheet (I am thining that maybe i will sort, renumber and export from there.) ?

 

Thank you.

Inventor 2012
Win 7 64-bit
Dell Precision T5400
Intel Xeon 2,5 GHz
8 Gb RAM
NVIDIA Quadro Fx 3700
6 REPLIES 6
Message 2 of 7
SoulAsasin
in reply to: SoulAsasin

Hey

 

I managed to solve my own problem 😄

 

You can sort by 3 criteria on a drawing part list and export from there.

 

My Work flow is the following:

   - generate de model

   - open it's drawing

   - Sort the BOM

   - Renumber

   - Override the assembly Bom Item numbers according to drawing part list.

   - save and close the drawing

   - sort the assembly BOM by Item

 

 

I attached the Assy rule and the drawing rule with some coments.

 

 

 

Hope this helps.

Inventor 2012
Win 7 64-bit
Dell Precision T5400
Intel Xeon 2,5 GHz
8 Gb RAM
NVIDIA Quadro Fx 3700
Message 3 of 7
Mark_Fry
in reply to: SoulAsasin

Hi SA,

I know that it has been a long time since you posted about your ilogic BOM requirements, but I am just now trying to get my head around ilogic. I have been asked to try and come up with a solution to a similar BOM output. My requirements are for example a stairway, to list all the different steal sizes used to create said stairway and be able to total up these sizes to give a total length of steel for each size for steel ordering and to have this in a file which can be printed out.

Do you think that this could be achieved? Could your solution be modified to provide the extra information?

 

Regards,

Mark

Message 4 of 7
ankurGCK9S
in reply to: SoulAsasin

Hi, SoulAsasin,

 

I have tried to use your ilogic rule for assembly, But it gives me an error as below 

"

Rule Compile Errors in Assy Rule, in 191048-MF-088.iam

Error on Line 37 : End of statement expected."

 

Let me know if I miss anything. I wanted to sort the BOM in a certain order such as > part Number,  description etc and thought your rule may be a good start. 

 

 

Message 5 of 7

Hi @ankurGCK9S ,

 

Welcome to the forum. The error you mention indicates that you likely did not get all of the lines copied to your rule... check the original code to see if it matches what you have and note that the last line reads: oDoc.Save

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 6 of 7

Hi Curtis,

 

Sorry for the delay in response and Thank you for the reply. I just add text file to my external rules and try to run it but it did not work. 


@Curtis_Waguespack wrote:

Hi @ankurGCK9S ,

 

Welcome to the forum. The error you mention indicates that you likely did not get all of the lines copied to your rule... check the original code to see if it matches what you have and note that the last line reads: oDoc.Save

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com


 

Message 7 of 7
rhasell
in reply to: ankurGCK9S

Hi

I have no idea what the code does, but if you comment out the "S" on line 73, the error goes away. I am unable to test the code due to my environment not being the same. (The "S" might mean something, but I am unable to debug it.)

 

Capture5.JPG

Reg
2024.2
Please Accept as a solution / Kudos

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

Post to forums  

Autodesk Design & Make Report