Assembly Constraint Functions Reference (iLogic)

iLogic provides rule functions for driving the suppression state of assembly constraints; they are useful when defining assembly level configurations with iLogic rules.

For example, suppose you are defining alternate positions for a component in an assembly. You can define all mates necessary to constrain the component in each location. Then, you can use a rule to suppress and unsuppress the mates as necessary to move the component in each configuration.

Inventor does not allow constraints that conflict. Create the constraints for one position of a component, and then manually suppress them before creating additional sets of constraints for alternate component positions. Once you have created all constraints necessary to position the component for each configuration, you can write the rules that choose between the constraints.

To access the assembly constraint functions, expand the Constraints node on the System tab in the Snippets area of the iLogic Edit Rule dialog.

Constraint.IsActive

Sets or reads the suppression state of a top-level assembly constraint.

Assign each constraint referenced in a rule a unique custom name:

If you manually change the suppression state of a constraint, it does not cause rules that reference it to fire automatically.

Syntax

Constraint.IsActive(“Mate:1”)

Constraint.IsActive(“SubAssem.iam”, “Mate:1”)

Examples

Set the suppression state:

If ConfigStyle = “A” Then
Constraint.IsActive("MateLeftSide:1") = true
Constraint.IsActive("MateRightSide:2") = false
ElseIf ConfigStyle = “B” Then
Constraint.IsActive("MateLeftSide:1") = false
Constraint.IsActive("MateRightSide:2") = true
End If

Read the suppression state:

If Constraint.IsActive("MateLeftSide:1")  Then (Do something)

Set or read the suppression state of a constraint in a subassembly (specify the subassembly file name and name of the constraint):

Constraint.IsActiveInDoc("SubAssem.iam", "Mate:1")

To copy and rename all the files in an assembly while keeping all the rules intact, use Constraint.IsActiveInComponent and specify a subassembly name instead of the filename.

Set using subassembly name:

If ConfigStyle = “A” Then
Constraint.IsActiveInDoc("SubAssem.iam", “LeftMate”) = true
Constraint.IsActiveInDoc("SubAssem.iam", “RightMate”) = false
ElseIf ConfigStyle = “B” Then
Constraint.IsActiveInDoc("SubAssem.iam", “LeftMate”) = false
Constraint.IsActiveInDoc("SubAssem.iam", “RightMate”) = true
End If

Read using subassembly name:

Constraint.IsActiveInDoc("SubAssem.iam",”LeftMate”) = true then (Do something)

Constraint.iMateDefIsActive

Suppresses or unsuppresses an iMate definition.

Constraint.iMateDefIsActive(“iMate:1”) = False

Suppresses the iMate definition with the name iMate:1 in the current rule document. The result is the same as suppressing it with the context menu in the user interface. While suppressed, the iMate definition is not available for mating purposes.

Constraint.iMateDefIsActive(“SubAssem:1”,“iMate:1) = False

Suppresses the iMate definition with the name iMate:1, in the component SubAssem:1.

Constraint.iMateDefIsActive(PartA:1”,“iMate:1”) = True

Unsuppresses the iMate definition with the name iMate:1, in the component part PartA:1.