Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic Rule to Change Parameter Values

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
1164 Views, 3 Replies

iLogic Rule to Change Parameter Values

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.

 

 

3 REPLIES 3
Message 2 of 4
cwhetten
in reply to: Anonymous

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

Message 3 of 4
Anonymous
in reply to: cwhetten

Thanks, I checked the "Don't run automatically" and it's working like I want it to. I did not know that running one rule will automatically run the other rules.
Message 4 of 4
cwhetten
in reply to: Anonymous


@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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report