External Rule not running after moving for Inventor 2024 to 2025

External Rule not running after moving for Inventor 2024 to 2025

corey.jewell
Participant Participant
383 Views
3 Replies
Message 1 of 4

External Rule not running after moving for Inventor 2024 to 2025

corey.jewell
Participant
Participant

I am in the process of migrating to 2025 from 2024. My external rule PartNumber stopped working correctly. I got the code corrected but only runs when I manually run the rule after I have saved the file or if I save for a second time. It looks like based on the the trigger menu it should run before and after a save event. Am I looking at this wrong? Is there a setting for an individual external rule for when it should be run? 

 

 

coreyjewell_0-1715719146949.png

coreyjewell_1-1715719408565.png

 

0 Likes
Accepted solutions (1)
384 Views
3 Replies
Replies (3)
Message 2 of 4

Michael.Navara
Advisor
Advisor

This is not a bug. Because when you run this rule BeforeSave first time (fila wasn't saved), ThisDoc.FileName(False) returns empty string.

0 Likes
Message 3 of 4

corey.jewell
Participant
Participant

Shouldn't it be running after save as well?

0 Likes
Message 4 of 4

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @corey.jewell 

 

If you run it after save, it will "smudge" the file and need to be saved again.

 

You can add this to the top of the rule and run this on the before save event, and it will handle the new documents with not file name.

'exit rule if file has not been saved
If ThisDoc.Document.FileSaveCounter = 0 Then Exit Sub

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes