PDA

View Full Version : Obscure variable


randall.temple
2009-04-07, 11:13 PM
I'm trying to remember an obscure variable that reflects whether the drawing has been changed. Does anyone know what it is?

I have added code to my acaddoc.lsp to purge the annoying xref drawing scales (2008 ) from each drawing as it is opened. The drawback is that every drawing now prompts to save on closing.

I'd like to reset this variable immediately after purging the scales, so the save prompt will only appear when substantive changes have been made.

Thanks,

R

steve.ashton
2009-04-07, 11:37 PM
Try DBMOD, set to 0 when drawing saved.

icbinr
2009-04-08, 02:12 PM
DBMOD is the variable but it is Read Only.

randall.temple
2009-04-08, 05:05 PM
Thanks, guys. That's the one I was looking for.

I found the solution to it's being read-only in irneb's post (#47) in this thread: Scale List Nightmares!! (http://forums.augi.com/showthread.php?t=74324&highlight=dbmod&page=5)

If you also don't want to have the "Modified, Save?" dialog pop-up (because this changes the DWG), then add (acad-push-dbmod) before the call to (c:ScaleListRemXRef) and (acad-pop-dbmod) after - this tricks AutoCAD into thinking nothing's changed.

It works perfectly! Thanks, irneb.

R

rkmcswain
2009-04-10, 12:25 PM
Thanks, guys. That's the one I was looking for.

I found the solution to it's being read-only in irneb's post (#47) in this thread: Scale List Nightmares!! (http://forums.augi.com/showthread.php?t=74324&highlight=dbmod&page=5)



It works perfectly! Thanks, irneb.

R

Why not just SAVE the drawing after running your code?

randall.temple
2009-04-10, 05:04 PM
Because the "Date Modified" of every drawing file would then reflect when it was last opened, not when it was last edited.

R

rkmcswain
2009-04-11, 03:28 PM
Because the "Date Modified" of every drawing file would then reflect when it was last opened, not when it was last edited.

R

I guess I don't get it. Purging the scale list entries from the drawing is an edit.

irneb
2009-04-14, 05:08 PM
It works perfectly! Thanks, irneb.
RYou're welcome :mrgreen:

I guess I don't get it. Purging the scale list entries from the drawing is an edit.You're correct! The problem comes that sometimes you're just opening (say) another consultant's drawing to view. But because you've got some cleanup actions running in ACADDOC.LSP (like the scale list reset) you are "editing" it every time you open the DWG. Just to get rid of the annoying "Save Changes ..." Yes / No / Cancel dialog, the push and pop DBMOD. It frees you to open something to just quickly view it, then close with only one click. Once you actually do something manually in the DWG the DBMOD is changed so you'll still be presented with the "Save Changes" dialog in that case.

rkmcswain
2009-04-14, 05:14 PM
You're correct! The problem comes that sometimes you're just opening (say) another consultant's drawing to view. But because you've got some cleanup actions running in ACADDOC.LSP (like the scale list reset) you are "editing" it every time you open the DWG. Just to get rid of the annoying "Save Changes ..." Yes / No / Cancel dialog, the push and pop DBMOD. It frees you to open something to just quickly view it, then close with only one click. Once you actually do something manually in the DWG the DBMOD is changed so you'll still be presented with the "Save Changes" dialog in that case.

I know how it works...;)
I guess I don't understand why it's difficult to just press no to the save changes prompt, or to just use TrueView to view the drawing.

I only want one thing setting DBMOD to 0 for me, and that is a successful write to disk.

RobertB
2009-04-14, 08:40 PM
I only want one thing setting DBMOD to 0 for me, and that is a successful write to disk.Actually, I also want that set when a drawing is finally completely opened.

Many of us do file tweaks when opening a drawing (or starting a new drawing based on a template) that doesn't necessarily mean that we have really modified the drawing. In these cases I don't want my users bothered with a Save prompt since, from their perspective, the drawing hasn't changed (they only opened it).