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: 

control parameter in an assy based on positional rep

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jasonrecords
124 Views, 1 Reply

control parameter in an assy based on positional rep

Is there a way to control a parameter in an assy based on positional rep with ilogic?

What is the code for this?

I would also like Inventor to run this Ilogic anytime the positional rep is changed, how do I do that?

 

I have tried this, but it is not working, I am still missing something.

jasonrecords_1-1680211462696.png

 

thanks,

 

Jason

Tags (2)
1 REPLY 1
Message 2 of 2
A.Acheson
in reply to: jasonrecords

Hi @jasonrecords 

This is accessed from the below rule. See API links for how to navigate and create the below rule. 

AssemblyComponentDefinition

PosRepManager

ActivePosRep

Name

 

Dim AssyDoc As AssemblyDocument = ThisDoc.Document
Dim AssyDef As AssemblyComponentDefinition = AssyDoc.ComponentDefinition
Dim RepMan As RepresentationsManager = AssyDef.RepresentationsManager
Dim ActivePos As PositionalRepresentation = RepMan.ActivePositionalRepresentation

If ActivePos.Name ="1" Then
   MessageBox.Show("Success")
End If

 

 

Running the rule and detecting the position change will need an event trigger which can be complicated. A work around is to use a form and change a text parameter, this could then be used to change the active pos rep and the rest of the rule. It will depend on how you want to run the rules to function. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan

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

Post to forums  

Autodesk Design & Make Report