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: 

IlLogic Change Assembly to Reference

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
ByranJansen
2110 Views, 3 Replies

IlLogic Change Assembly to Reference

Is there a way to set an assemblies bill of material setting to reference through iLogic?

3 REPLIES 3
Message 2 of 4
Shawn_79
in reply to: ByranJansen

I have used the following code with parts (mainly virtual parts).  I did a quick test and it appears to also work with assemblies.

 

I have also included the line of code to set the BOM structure back to default.

 

=======================================

doc = ThisDoc.Document 'This line only needs to appear once in the rule
vPart:1 = Component.InventorComponent("Part:1") 'This line is only required once per virtual part
'vPart:1.BOMStructure = BOMStructureEnum.kReferenceBOMStructure  'Sets BOM Structure to Reference (Remove from BOM)
'vPart:1.BOMStructure = BOMStructureEnum.kDefaultBOMStructure  'Sets BOM Structure to Default (Includes on BOM)

==========================================

 

-Shawn

Message 3 of 4
ByranJansen
in reply to: Shawn_79

Hi

I would like to change between reference and purchased but if I replace  (kDefaultBOMStructure) with (kPurchasedBOMStructure) I get an error message E_InvalidAug any idea how to fix this? I have sixteen different instances of the assembly that I am changing  what is the best way to index through them?

Message 4 of 4
Shawn_79
in reply to: ByranJansen

The way I use the code it only controls the BOM strucuture at the parent assembly level (think of it as an assembly level override.)  So, in your case the BOM strucure at the child assembly would be set to purchased.  At the parent level you only have two choices; default and reference.  Reference would remove it from the BOM and default would use the default BOM structure (purchase in this example.)  The manual version of this process is to right click on the assembly in the model browser and change the BOM structure (see attachment.)

 

This method controls the BOM structure of each instance.  It would be possible to have the same assembly inserted several times with different BOM structures.  If you go back to the child assembly to make the change it then would change for all instances.

 

-Shawn

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

Post to forums  

Autodesk Design & Make Report