Save vs Save As Ilogic Trigger

Save vs Save As Ilogic Trigger

acanx21
Enthusiast Enthusiast
390 Views
3 Replies
Message 1 of 4

Save vs Save As Ilogic Trigger

acanx21
Enthusiast
Enthusiast

We have ilogic code that is triggered to run on a save. 

 

But whenever we do a save as on a part or assembly, it also triggers the code to run for the initial save as and then again for the save after we've made the changes. 

 

Is there any way to skip running all the code on the save as? 

 

Mostly just trying to stop it from running so that it doesn't slow us down running multiple times when we don't need it to. 

0 Likes
391 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @acanx21.  Are yo using the Event Triggers dialog, or custom event handler code?  If you are using the Event Triggers dialog, then are you using the 'before save' event, or 'after save' event?  Does the code that gets ran when the event happens have instructions within it to save the document?  If so, you may need to remove that from the code.  If that is not the problem, you may have to use the more complicated route of creating custom event handler code for this task.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

acanx21
Enthusiast
Enthusiast

I am currently using the Event Triggers dialog.

 

It's set to the Before Save event because the code changes iproperties within the part when saved and setting it to run after save made the part dirty and needing to save again.

0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

Does the rule include instructions to save the document?  If so, that will cause 2 saves.  Because the trigger means that a save is already about to happen, but this code is simply running before that save happens.  Once the rule finishes it will continue to save on its own.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes