Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

run all rules vs regenerate all rule

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
adam_liMNCRV
317 Views, 4 Replies

run all rules vs regenerate all rule

Regenerate all Rules vs Run all Rules

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

 

4 REPLIES 4
Message 2 of 5

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

 

Message 3 of 5
WCrihfield
in reply to: adam_liMNCRV

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)

Message 4 of 5
WCrihfield
in reply to: Michael.Navara

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)

Message 5 of 5
Michael.Navara
in reply to: WCrihfield

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

Post to forums  

Autodesk Design & Make Report