Inventor General Discussion

Inventor General Discussion

Reply
Contributor
Calico5
Posts: 12
Registered: ‎10-11-2011
Message 1 of 5 (801 Views)
Accepted Solution

Changing Positional Representation of SubAssembly Using iLogic

801 Views, 4 Replies
10-11-2011 01:05 AM

Hello,

 

I tried searching the forums but couldnt find a solution. 

 

The problem

- I have a top level assembly (lets call it '01.iam', which contains a range of subassemblies (e.g. '02.iam', '03.iam' etc)

- The subassemblies have positional representations

- I want to be able to manipulate the pos.rep's from the top level using iLogic. 

 

I found this snippet of code on the forum which works when I create the rule in one of the subassemblies. 

 

ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager.PositionalRepresentations("MyPosRep").Activate

 But I'm having trouble adapting it to work from the top level, as I would like all my rules saved in one place. 

 

Any help or information will be much appreciated,

 

Regards



You should be able to do it with the API method PositionalRepresentation.SetPositionalRepresentationOverride.

But maybe you don't need to set the subassembly posreps independently using code?  If you want a subassembly to switch to MyPosRep when the top-level assembly is switched, you can tie them together manually.  At the top level, while MyPosRep is active, right click on the subassembly and choose Representation...  Select MyPosRep in the subassembly.  Then the posreps will be tied together.

SubAssemPosRep.png

Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 2 of 5 (758 Views)

Re: Changing Positional Representation of SubAssembly Using iLogic

10-16-2011 03:31 PM in reply to: Calico5

You should be able to do it with the API method PositionalRepresentation.SetPositionalRepresentationOverride.

But maybe you don't need to set the subassembly posreps independently using code?  If you want a subassembly to switch to MyPosRep when the top-level assembly is switched, you can tie them together manually.  At the top level, while MyPosRep is active, right click on the subassembly and choose Representation...  Select MyPosRep in the subassembly.  Then the posreps will be tied together.

SubAssemPosRep.png



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Contributor
Calico5
Posts: 12
Registered: ‎10-11-2011
Message 3 of 5 (740 Views)

Re: Changing Positional Representation of SubAssembly Using iLogic

10-17-2011 06:32 AM in reply to: MjDeck

Thanks again Mike, can't believe I didnt think of doing that! 

 

Your help is much appreciated,

Regards

 

Member
martjonker
Posts: 5
Registered: ‎12-11-2012
Message 4 of 5 (562 Views)

Re: Changing Positional Representation of SubAssembly Using iLogic

12-12-2012 12:29 AM in reply to: MjDeck

Goodmorning,

 

I have the same problem, but for me its not possible to tie the pos reps together. I'm configuring a band with different supports. Each support is configured with a range; 600-900, 900-1200, 1200-1500 etc. those ranges can be adjust by 50mm and those steps are specified by the pos reps (see attached image).

All the different supports are put in the top assembly and in this assembly I want to switch between the positional representations. I tried to use: 

 

ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager.PositionalRepresentations("MyPosRep").Activate

 

But it won't work. I guess I have to replace "ComponentDefinition" in one way or another to the component name, but I don't know how.

 

I hope you understand my problem and you are able to help me!

 

-Mart

Member
martjonker
Posts: 5
Registered: ‎12-11-2012
Message 5 of 5 (530 Views)

Re: Changing Positional Representation of SubAssembly Using iLogic

12-17-2012 03:12 AM in reply to: martjonker

Band = conveyor-belt.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.