• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor

    Reply
    Contributor
    Calico5
    Posts: 12
    Registered: ‎10-11-2011
    Accepted Solution

    Changing Positional Representation of SubAssembly Using iLogic

    362 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

    

    Please use plain text.
    Employee
    Posts: 932
    Registered: ‎02-24-2009

    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.

    Please use plain text.
    Contributor
    Calico5
    Posts: 12
    Registered: ‎10-11-2011

    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

     

    Please use plain text.
    Member
    Posts: 5
    Registered: ‎12-11-2012

    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

    Please use plain text.
    Member
    Posts: 5
    Registered: ‎12-11-2012

    Re: Changing Positional Representation of SubAssembly Using iLogic

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

    Band = conveyor-belt.

    Please use plain text.