Secondary rules

Secondary rules

blandb
Mentor Mentor
265 Views
4 Replies
Message 1 of 5

Secondary rules

blandb
Mentor
Mentor

Just out of curiosity (maybe I have missed it) did something change to where if we have say (3) rules and they are all unsuppressed, that the second and third rules will not auto run after the first rule has completed? We now have to force the second and third rules to run via "runother"?

 

Just wondering why mine will no longer run them in order.

Autodesk Certified Professional
0 Likes
266 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Hi @blandb.  I have not heard anything yet about if Autodesk changed any default rule running order or auto run behavior.  But there are a couple of quick settings you can check within those rules.  When you have the rule editor dialog open (to edit those rules), click on the Options tab then check which settings you have checked/unchecked.  Sounds similar to a couple of those settings:  'Fire Dependent Rules Immediately', and 'Don't Run Automatically'.  Those settings are saved within each rule, so you would have to check each rule.  If that's not it, you can check out the various settings within the iLogic Add-In's Automation area by typing in "iLogicVb.Automation." somewhere within a rule, then exploring the available stuff there.  There are 3 things about 'delayed rule running mode'.  You can Get/Set the 'RuleRunningOrderOption'.  RulesEnabled, RulesOnEventsEnabled, etc.  And if working with the Event Triggers, you can also check out the Options button within that dialog.  (The settings within that dialog will overrule the similar sounding settings within iLogicVb.Automation that you can acces by code.)

 

I'm still using Inventor 2022.2.2, but I know that I can have a lot of rules within a document without any of them automatically running, if I don't want them to, even without suppressing them.  If I don't have any of those rules listed within the Event Triggers, and don't have any unquoted local parameter names within any of them, then they generally won't run automatically.  Since I tend to use external iLogic rules and global iLogic forms for the vast majority of my automation, what I will often do to benefit from local document triggering behavior is create a very simple local rule that just runs an external rule.  Then that external rule will either have my main code, or it will simply contain instructions to run a series of other external rules in the order I choose, to have more control.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

blandb
Mentor
Mentor

Fire dependent and Don't run automatically are NOT checked. But I know I have never messed with it in the past and all rules seemed to run in order, so did they used to be set by default? I have been adding the rules to run via "runrule". Maybe this is the more robust way to do it? Since you have control of what you want when you want vs. just running in order?

Autodesk Certified Professional
0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor

I generally leave the 'Fire Dependent Rules Immediately' setting turned on, but I honestly do not recall which way they are all set by default by Autodesk.  Yes.  Using the RunRule/RunExternalRule type lines are definitely my main way to ensure control over making sure rules run when intended/needed.  I have read the same references that say that by default local rules are supposed to run in the same order you have them listed within the document...when they are supposed to run automatically...but I generally just don't leave anything to chance anymore.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 5

WCrihfield
Mentor
Mentor

I just looked into the 'RuleRunningOrder', which is defined within the Autodesk.iLogic.Interfaces reference as an Enum, and found a piece of information that may be useful here.  It only has two options (Browser or Legacy).  The Legacy option says that it will act the way that Inventor 2020 and older versions did for rule running order.  The Browser option is mostly the same, but adds that it, if possible it will run the rules in the order they appear in the iLogic browser.  So that is something that has changed.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes