.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Catch AUTO_SAVE before saving the document

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
joantopo
493 Views, 3 Replies

Catch AUTO_SAVE before saving the document

Hi.

 

I need a way to catch the AUTO_SAVE before saving the document to change a bool variable to false due to saving process fires the ObjectModified event always and I have some operations in this last event.

 

Note: CommandWillStart event doesn´t work with "AUTO_SAVE" command.

 

Thanks in advance.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
3 REPLIES 3
Message 2 of 4
Keith.Brown
in reply to: joantopo

Did you try the database.beginsave event?

Message 3 of 4
joantopo
in reply to: Keith.Brown

Yes, right now  I have tried it:

 

   static void callback_BeginSave(object sender, DatabaseIOEventArgs e)
       {
           variables_globales.GuardadoDibujo = true;
       }
       static void callback_SaveComplete(object sender, DatabaseIOEventArgs e)
       {
           variables_globales.GuardadoDibujo = false;
       }

BeginSave event works fine, but the trouble is with SaveComplete event.

 

I have other events such as ObjectErased, ObjectModified and they are fired in the last moment after SaveComplete event, but then my global variable is false and it should be still true.

 

I don´t know where I should change it back in false value again.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 4 of 4
mcicognani
in reply to: joantopo

In both events handler, the DatabaseIOEventArgs e.Filename property contains the name of the file being saved, if it's an autosave, the extension should be .sv$

 

Given that, you always know if you're dealing with an autosave or a user save command.

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost