Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to use CheckForSave

How to use CheckForSave

haggi_master
Advocate Advocate
761 Views
2 Replies
Message 1 of 3

How to use CheckForSave

haggi_master
Advocate
Advocate

From the docs:

 

"The function returns false if the user cancels out of the save, true otherwise. The function itself does NOT perform any saving, it only issues the prompt if the scene has been modified and returns the user's decision about further actions. Any actual saving or checking for file existence have to be performed by the MAXScript code."

 

Well, the docs are wrong I fear.

 

If I use CheckForSave() I get a dialog with the options "Save", "Don't Save" and "Cancel". From the description, the command should not do anything but returning true or false. Well if I select "Save", it saves the scene. Now If I select "Don't Save", I'd expect to get more or less the same result as if I select "Cancel" because it is the same action, but "Don't Save" gives me a "true" whereas "Cancel" returns "false". In both cases nothing should be done. How can I distinguish between "Don't save" and "Save"?

 

And finally if I have an empty scene, the command returns "true" what can be "Save the scene" or "No do not save the scene".

 

Does anyone have an idea for a better way to find out if something has changed in the scene?

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

haggi_master
Advocate
Advocate

Seems to work great. Thanks a lot.

0 Likes