Prevent parameter change from automatically running ilogic rule.

Prevent parameter change from automatically running ilogic rule.

f_calebh
Advocate Advocate
1,693 Views
4 Replies
Message 1 of 5

Prevent parameter change from automatically running ilogic rule.

f_calebh
Advocate
Advocate

I'm sure this question is out there, but I'm having a hard time finding it. How do I prevent a rule from automatically running a referenced parameter when it's changed?  I have a form with multiple user parameter changes and button to run a rule that exports the part as an stl (parameters are used when naming the file). I'm running into an issue where the rule runs whenever a single parameter is changed instead of waiting for the button to be pushed.

0 Likes
Accepted solutions (1)
1,694 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor
Accepted solution

If you are using a local ilogic rule, and a local iLogic form, you will need to make some changes in your code.

Within the local iLogic rule, instead of using the local parameters directly by their names, which causes the name to become blue in recognition of it being a local parameter, you instead need to format these instance differently.

So, instead of using a line like this:

Area = (Length * Width)

(where Area, Length, and Width are all local parameters, and are blue by default)

write it this way instead:

Parameter("Area") = (Parameter("Length) * Parameter("Width"))

This will stop the local rule from automatically running each time one of those local parameters changes.

When using a local ilogic Form, the parameter changes are immediate, unlike when you are using a Global iLogic form.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

WCrihfield
Mentor
Mentor

Also, if you have the local rule set up within the Event Triggers dialog, under something like "Any Model Parameter Change" or "Part Geometry Change", this will cause the rule to run each time you change a parameter within that local iLogic form.  You may need to remove them from those Event Triggers, if you don't need them to be in there.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 5

f_calebh
Advocate
Advocate

I'll try that out.

 

One thing I just noticed in the form option was the behavior for a button can be set to "Apply and then Run Rule" or "Apply and then Close and then Run Rule" Using this setting on my button actually allowed me to make all my changes in the form before automatically running the rule. 

0 Likes
Message 5 of 5

f_calebh
Advocate
Advocate

This is exactly what I needed, thanks. When using the button settings, you couldn't preview the model change because the parameters weren't applying immediately either.

0 Likes