Inventor General Discussion

Inventor General Discussion

Reply
Contributor
ByranJansen
Posts: 21
Registered: ‎10-07-2011
Message 1 of 4 (869 Views)
Accepted Solution

IlLogic Change Assembly to Reference

869 Views, 3 Replies
10-26-2011 03:33 PM

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

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

Active Contributor
Shawn_79
Posts: 37
Registered: ‎06-17-2010
Message 2 of 4 (854 Views)

Re: IlLogic Change Assembly to Reference

10-28-2011 09:40 AM 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

Contributor
ByranJansen
Posts: 21
Registered: ‎10-07-2011
Message 3 of 4 (839 Views)

Re: IlLogic Change Assembly to Reference

11-01-2011 11:36 AM 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?

Active Contributor
Shawn_79
Posts: 37
Registered: ‎06-17-2010
Message 4 of 4 (825 Views)

Re: IlLogic Change Assembly to Reference

11-02-2011 02:58 AM 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.