Reply

saving files

[ Edited ]

Hi,

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

5 REPLIES

RE: saving files

[ Edited ]

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

RE: saving files

[ Edited ]

Hi polk,

 

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

RE: saving files

[ Edited ]

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

HTH,

Julian

 

Posted by: Julian Guillo
Post date: 1/25/2012 10:22:06 PM

RE: saving files

[ Edited ]

Hi polk,

 

just like Jason said, there are windows APIs especially for that.

 

You could check here this document page 126 :

http://www.plm.automation.siemens.com/en_us/Images/Solid_Edge_API_tcm1023-125829.pdf

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

RE: saving files

[ Edited ]

Thanks.

Finished that and forgot to post BIG thanks for all of comments

 

Posted by: joseph polk
Post date: 2/1/2012 4:28:33 PM