How can I tell solid Edge to save a file for me?
scenario: I get an event from power supply that power is about to run out & I would like to initiate the save before any data will lost..
Posted by: joseph polk
Post date: 1/25/2012 3:28:27 PM
You could write a fairly simple C++ addin to do this for you. There are Windows APIs for handling power events, shutdown events, etc.
Posted by: Jason Newell
Post date: 1/25/2012 4:10:21 PM
following Jasons approach is good , but still could lead to possible data loss on newly created and and not yet saved Solid Edge documents which is quite hardor also impossible to manage by an addin.
Posted by: Wolfgang Kunert
Post date: 1/25/2012 10:08:16 PM
Detecting if a file is new and never saved it's not difficult.
oDoc.FullName would show the default name (f.e. Part1.par) without any path. (oDoc is the SE Document object)
So if you compare:
(oDoc.FullName = System.Io.Path.GetFileName(oDoc.FullName)) is True
Then you could svae the file with a Temporary filename or something
Posted by: Julian Guillo
Post date: 1/25/2012 10:22:06 PM
just like Jason said, there are windows APIs especially for that.
You could check here this document page 126 :
It show how to trap windows events.
Check for the message WM_ENDSESSION then you can initiate a save.
Posted by: David Shooner
Post date: 2/1/2012 1:35:50 AM