Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
634 Views, 3 Replies

iLogic: add constraint that is overridden in certain Positional Representations

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?

philip1009
in reply to: Anonymous

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

Anonymous
in reply to: philip1009

Awesome! Thank you kindly!

johnnymac2
in reply to: philip1009

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