run all rules vs regenerate all rule

adam_liMNCRV
Advocate
Advocate

run all rules vs regenerate all rule

adam_liMNCRV
Advocate
Advocate
Regenerate all Rules vs Run all Rules

Whats the difference between 'Regenerate all Rules' and 'Run all Rules' ?

 

0 Likes
Reply
Accepted solutions (2)
247 Views
4 Replies
Replies (4)

Michael.Navara
Advisor
Advisor
Accepted solution

The difference is in background. The iLogic code can't be executed directly. It must be compiled before.

Regenerate - compiles and executes the rule

Run - just run the rule without compilation

 

If you test the rule bellow, there are small differences.

  • If you press Run the value of i will be increased in each run.
  • If you press Regenerate the value of i will be reset to 1
Sub main
	Logger.Debug(i)
	i += 1
End Sub

Private Shared i As Integer = 1

 

Run results

INFO| 19: >>---------------------------
DEBUG|1
INFO| 20: >>---------------------------
DEBUG|2
INFO| 21: >>---------------------------
DEBUG|3

 

Regenerate results

INFO| 22: >>---------------------------
DEBUG|1
INFO| 23: >>---------------------------
DEBUG|1
INFO| 24: >>---------------------------
DEBUG|1

 

WCrihfield
Mentor
Mentor
Accepted solution

Hi @adam_liMNCRV.  Another difference is that the 'regenerate' action will also reconnect any parameters who's links have been broken, if any, while just running the rule(s) will not.  For instance, if the internal iLogic rule contained some blue, unquoted names of local parameters within it, then you deleted or renamed one or more of them, then recreated or changed their names back to the original.  That would normally break the automatic connection / triggering action inherent to using parameters that way.  To fix that link/connection/automatic triggering again, regenerate the rule(s).  This may also happen if you create the rule, before the parameter exists yet, then create the parameter afterwards.  The connection / triggering will not be in effect in the rule yet, until you regenerate the rule.  Usually...it's been a while since I encountered a similar scenario, but that's how it worked last time I had to use it.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

WCrihfield
Mentor
Mentor

Hi @Michael.Navara.  What you posted looks pretty interesting, but when I tried it I do not get results like that.  No matter if I run the rule, or regenerate the rule, I just get empty entries in the iLogic Logger window.

I ran this both way many times, but the results show below are...the first 3 are regular Run Rule, while the second 3 are Regenerate Rule.  I am running Inventor Pro 2024.3 on Windows 11 PC, if that matters I am not sure.

WCrihfield_0-1719319940956.png

 

Edit:  Nevermind...forgot about Log Level setting...it was set to Info level.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

Michael.Navara
Advisor
Advisor
0 Likes