Author Topic: How do I check if drawing is saved?  (Read 2148 times)

0 Members and 1 Guest are viewing this topic.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
How do I check if drawing is saved?
« 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!

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: How do I check if drawing is saved?
« Reply #1 on: March 31, 2013, 07:08:02 AM »
Check the DWGTITLED System Variable

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: How do I check if drawing is saved?
« Reply #2 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.
« Last Edit: March 31, 2013, 07:47:27 AM by Alien »

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: How do I check if drawing is saved?
« Reply #3 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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: How do I check if drawing is saved?
« Reply #5 on: March 31, 2013, 10:33:38 PM »
Thank you! :) DBMOD worked
« Last Edit: March 31, 2013, 10:59:30 PM by Alien »

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: How do I check if drawing is saved?
« Reply #6 on: April 01, 2013, 07:30:52 AM »
« ... »

Thanks for the link to the new documentation Kerry  8-)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How do I check if drawing is saved?
« Reply #7 on: April 01, 2013, 07:42:27 AM »
That's cool Lee.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

BlackBox

  • King Gator
  • Posts: 3770
Re: How do I check if drawing is saved?
« Reply #8 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' 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 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)?
"How we think determines what we do, and what we do determines what we get."

TheMaster

  • Guest
Re: How do I check if drawing is saved?
« Reply #9 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' 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 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.

Gasty

  • Newt
  • Posts: 90
Re: How do I check if drawing is saved?
« Reply #10 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

BlackBox

  • King Gator
  • Posts: 3770
Re: How do I check if drawing is saved?
« Reply #11 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' 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 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
"How we think determines what we do, and what we do determines what we get."