Hello, I have an iLogic rules question.
Let's say I have a parameter, call it A1. Now lets say I have a rule called "Add", and everytime I run this rule, i increment A1 by 1 (Parameter("A1")=A1+1).
This is all well and good, until I add another rule, let's call it "Subtract" which decrements A1 by 1 (Parameter("A1")=A1-1).
Now when I try to run any of these, rules, neither works. I noticed that in the parameters box, theres a column called "Driving Rule". Does this mean that the parameter can only be driven by one rule? Is there a work around for this?
Thanks for any insights you might have.
Solved! Go to Solution.
Solved by cwhetten. Go to Solution.
Actually, my first guess is that they are BOTH working, but since one is adding 1 and the other is subtracting 1, it looks the same as if neither rule worked.
By default, rules are triggered automatically when any parameter they reference is changed. So, running one rule will change the value of A1, and since the other rule is referencing A1, it will be automatically triggered.
There are a couple of ways to make it so these rules aren't automatically triggered. The simplest way is to go to the options tab in each rule and check the option to "Don't run automatically". The other way is to only access the A1 parameter by using the following:
Parameter("A1")
I see that you are doing this for one of the references in each rule, but not for the second (the second reference will show up as blue text in the editor). Any blue parameters in your editor will automatically trigger the rule when they are changed.
Please click "Accept as Solution" if this response answers your question.
Cameron Whetten
Inventor 2014
@Anonymous wrote:
...I did not know that running one rule will automatically run the other rules.
Just to be clear, this is not strictly true. In your case, it was happening becase of this:
@cwhetten wrote:
Any blue parameters in your editor will automatically trigger the rule when they are changed.
Cameron Whetten
Inventor 2014