Constraint suppression rule

Constraint suppression rule

mayla_difrancesco
Contributor Contributor
113 Views
1 Reply
Message 1 of 2

Constraint suppression rule

mayla_difrancesco
Contributor
Contributor

I wrote a very simple code in the assembly to deactivate constraints based on a condition.


If incl_sca = 45 Then
Constraint.IsActive("Coincidente:389") = False
Constraint.IsActive("Coincidente:392") = True
Constraint.IsActive("Coincidente:390") = False
Constraint.IsActive("Coincidente:391") = True
Else
Constraint.IsActive("Coincidente:389") = True
Constraint.IsActive("Coincidente:392") = False
Constraint.IsActive("Coincidente:390") = True
Constraint.IsActive("Coincidente:391") = False
End If

 

I have already used the command several times and it has always worked.

I double-checked both the constraint names and incl_sca.

Now, however, when I run the rule, all the constraints remain active, creating invalid constraints and errors in the assembly. What can I do?

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

WCrihfield
Mentor
Mentor
Accepted solution

Is that the whole code of the rule, or just part of it?  Sometimes we may need to include an 'update' of the document early in the code, before our code begins to act upon that document, just to make sure recent changes to the document, or its referenced documents have taken full effect.  Also, the 'IsActive = True' phrase essentially means 'Suppressed = False', and often when changing the suppressed status of things, they need to be done in 'opposite' order.  What I mean is, when suppressing things, they get suppressed in a certain order, then when they get unsuppressed, they get unsuppressed in the opposite order than they were suppressed in, instead of in the same exact order.  This is a common issue.  Not sure if 'order of operations' is the issue there though.  Does the value of that 'incl_sca' parameter get changed before that point in the rule's code?  If so, that parameter value change may have not taken effect yet, and the document may need to be updated between parameter value change and the suppression state changes.  Just throwing some ideas out there.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)