control parameter in an assy based on positional rep

control parameter in an assy based on positional rep

jasonrecords
Advocate Advocate
274 Views
1 Reply
Message 1 of 2

control parameter in an assy based on positional rep

jasonrecords
Advocate
Advocate

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

0 Likes
Accepted solutions (1)
275 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor
Accepted solution

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
0 Likes