iLogic: add constraint that is overridden in certain Positional Representations

iLogic: add constraint that is overridden in certain Positional Representations

Anonymous
Not applicable
722 Views
3 Replies
Message 1 of 4

iLogic: add constraint that is overridden in certain Positional Representations

Anonymous
Not applicable

Just adding constraints is easy enough. But I want to override that constraint (modifying the dimension or suppressing the constraint altogether) in a Positional Representation.

 

Is it even possible?

0 Likes
Accepted solutions (1)
723 Views
3 Replies
Replies (3)
Message 2 of 4

philip1009
Advisor
Advisor
Accepted solution

It is possible, just takes a bit of setup to get there.

 

objDef = ThisDoc.Document.ComponentDefinition
objPosRep = objDef.RepresentationsManager.PositionalRepresentations.Item("PositionName")
colConstraints = objDef.Constraints

 

objPosRep.SetRelationshipSuppressionOverride(colConstraints.Item("Mate1"), True)

'If you have an object with the constraint creation earlier in your code, you can use that instead of calling the 'constraint by name.

 

bojPosRep.SetRelationshipValueOverride(colConstraints.Item("Mate1"), kRelationshipOffsetValue, "10 in")

 

You can explore the majority of Inventor's API (Application Programming Interface) through it's help guide.  Just keep in mind that not every feature and add-in is available, and not all that is available can be used in iLogic:

API Help_edited.jpg

0 Likes
Message 3 of 4

Anonymous
Not applicable

Awesome! Thank you kindly!

0 Likes
Message 4 of 4

johnnymac2
Participant
Participant

This code snippet doesn't work when the constraints originate from a composite iMate. Is it possible to suppress constraints within a composite iMate?

Thanks,

 

john 

0 Likes