TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: whdjr on October 10, 2005, 08:25:40 AM

Title: Saved vs. New Drawing
Post by: whdjr on October 10, 2005, 08:25:40 AM
Is there an easy way to tell if a dwg is saved or if it is brand new?  (other than just reading the filename to see if it is called untitled-X).
Title: Re: Saved vs. New Drawing
Post by: MP on October 10, 2005, 08:33:13 AM
Look up these sys vars -- dwgtitled, dbmod as well as the lisp functions -- acad-push-dbmod, acad-pop-dbmod.
Title: Re: Saved vs. New Drawing
Post by: CAB on October 10, 2005, 08:34:46 AM
Would checking the Total Editing Time tell you anything?
Title: Re: Saved vs. New Drawing
Post by: MP on October 10, 2005, 08:39:20 AM
Good thinking Alan.
Title: Re: Saved vs. New Drawing
Post by: whdjr on October 10, 2005, 08:54:18 AM
Thanks guys I'll look into these. :-)
Title: Re: Saved vs. New Drawing
Post by: whdjr on October 10, 2005, 09:11:32 AM
It seems like 'dwgtitled' is the way to go.

dwgtitled     -    Indicates whether the current drawing has been named.(by the user)

0   Drawing has not been named
1   Drawing has been named

dbmod   -   Only tells you if the database is empty, has data in it, or a command has been called. 
                 It is not a sure fire way to tell if the dwg has been saved.

acad-push-dbmod and acad-pop-dbmod seem like a way to add data to a dwg database and then reset the dbmod sysvar so the dwg acts as if it hasn't been modified since the last save.

I wasn't sure where to look for the Editting time.  All I could get was the 'time' function and that looked like too much info.

Thanks for all the help guys,
Title: Re: Saved vs. New Drawing
Post by: whdjr on October 10, 2005, 09:36:44 AM
Just thinking out loud...

Do you think 'acad-push-dbmod' and 'acad-pop-dbmod' could be used in conjunction with ObjectDBX to keep the drawing preview intact?
Title: Re: Saved vs. New Drawing
Post by: Kerry on October 10, 2005, 09:38:45 AM
I have a recollection that Total Editing Time is affected by the Template drawing used.
Seems you have it sorted using 'dwgtitled', so that may be irrelevant anyway, but worth checking if you decide to have another look at the time.

Title: Re: Saved vs. New Drawing
Post by: CAB on October 10, 2005, 09:52:38 AM
I think you're correct there as my new drawings inherit the template editing time.
Title: Re: Saved vs. New Drawing
Post by: MP on October 10, 2005, 09:56:41 AM
Do you think 'acad-push-dbmod' and 'acad-pop-dbmod' could be used in conjunction with ObjectDBX to keep the drawing preview intact?

I don't see how but I'l like to hear your logic.
Title: Re: Saved vs. New Drawing
Post by: whdjr on October 10, 2005, 10:28:10 AM
Now that I sit and try to pen my logic I see the huge flaw in my thought process(or lack of). :oops:
Title: Re: Saved vs. New Drawing
Post by: whdjr on October 10, 2005, 10:29:53 AM
I guess I was thinking there might be a way to add data to a DBX database without actually saving the file, thus losing the preview. :lol: