TheSwamp

Code Red => .NET => Topic started by: nobody on March 31, 2013, 06:57:50 AM

Title: How do I check if drawing is saved?
Post by: nobody on March 31, 2013, 06:57:50 AM
I'd like to check to see if user has saved before running my routine... anyone have an example that would help me?

Thanks!
Title: Re: How do I check if drawing is saved?
Post by: Lee Mac on March 31, 2013, 07:08:02 AM
Check the DWGTITLED System Variable
Title: Re: How do I check if drawing is saved?
Post by: nobody on March 31, 2013, 07:43:13 AM
Check the DWGTITLED System Variable

Thanks! But I'm not sure that addresses my needs.  The drawing will be named, I just want to make sure they saved their work before running the routine.
Title: Re: How do I check if drawing is saved?
Post by: Lee Mac on March 31, 2013, 07:57:32 AM
The drawing will be named, I just want to make sure they saved their work before running the routine.

Oh I see, I thought you were looking to determine whether the drawing was saved or unsaved.
In that case, perhaps check either DBMOD or TDUPDATE, or just save the drawing when the routine is run.
Title: Re: How do I check if drawing is saved?
Post by: Kerry on March 31, 2013, 08:35:22 PM

http://docs.autodesk.com/ACD/2014/ENU/index.html?url=files/GUID-CBB74093-BB22-49CC-B54A-D33D7E92694C.htm,topicNumber=d30e702324
Title: Re: How do I check if drawing is saved?
Post by: nobody on March 31, 2013, 10:33:38 PM
Thank you! :) DBMOD worked
Title: Re: How do I check if drawing is saved?
Post by: Lee Mac on April 01, 2013, 07:30:52 AM
« ... »

Thanks for the link to the new documentation Kerry  8-)
Title: Re: How do I check if drawing is saved?
Post by: Kerry on April 01, 2013, 07:42:27 AM
That's cool Lee.
Title: Re: How do I check if drawing is saved?
Post by: BlackBox on April 01, 2013, 02:51:41 PM
Interestingly the 'Save and Close' section uses System.Convert.ToInt16(), whereas the 'Set and Return System Variables (http://docs.autodesk.com/ACD/2014/ENU/files/GUID-CBB74093-BB22-49CC-B54A-D33D7E92694C.htm)' section uses System.Convert.ToInt32()... Any gain in either case given the object returned from GetSystemVariable()?

Admittedly, I have some reading to do on the available System.Convert (http://msdn.microsoft.com/en-us/library/bds4fye2(v=vs.100).aspx) Methods, so I am not fully versed on the differences in 16-Bit, 32-Bit, and 64-bit signed integers, but should there be any consideration for code operating on verticals which are only available on 64-bit now (such as Civil 3D 2014)?
Title: Re: How do I check if drawing is saved?
Post by: TheMaster on April 01, 2013, 05:12:21 PM
Interestingly the 'Save and Close' section uses System.Convert.ToInt16(), whereas the 'Set and Return System Variables (http://docs.autodesk.com/ACD/2014/ENU/files/GUID-CBB74093-BB22-49CC-B54A-D33D7E92694C.htm)' section uses System.Convert.ToInt32()... Any gain in either case given the object returned from GetSystemVariable()?

Admittedly, I have some reading to do on the available System.Convert (http://msdn.microsoft.com/en-us/library/bds4fye2(v=vs.100).aspx) Methods, so I am not fully versed on the differences in 16-Bit, 32-Bit, and 64-bit signed integers, but should there be any consideration for code operating on verticals which are only available on 64-bit now (such as Civil 3D 2014)?

I don't believe there's any system variables that are 32 bit ints. Most are 16 bit, so it's moot for the purpose of comparing it to some value. You can use either.
Title: Re: How do I check if drawing is saved?
Post by: Gasty on April 01, 2013, 05:37:22 PM
Hi,

I'm not sure it's the only 32 bit integer, but TREEMAX (default value is 10000000) it's a 32 bit integer variable.

Gaston Nunez
Title: Re: How do I check if drawing is saved?
Post by: BlackBox on April 01, 2013, 06:34:50 PM
Interestingly the 'Save and Close' section uses System.Convert.ToInt16(), whereas the 'Set and Return System Variables (http://docs.autodesk.com/ACD/2014/ENU/files/GUID-CBB74093-BB22-49CC-B54A-D33D7E92694C.htm)' section uses System.Convert.ToInt32()... Any gain in either case given the object returned from GetSystemVariable()?

Admittedly, I have some reading to do on the available System.Convert (http://msdn.microsoft.com/en-us/library/bds4fye2(v=vs.100).aspx) Methods, so I am not fully versed on the differences in 16-Bit, 32-Bit, and 64-bit signed integers, but should there be any consideration for code operating on verticals which are only available on 64-bit now (such as Civil 3D 2014)?

I don't believe there's any system variables that are 32 bit ints. Most are 16 bit, so it's moot for the purpose of comparing it to some value. You can use either.

As always, thank you for the prompt clarification, Tony... That is exactly what I was after.

Cheers