Author Topic: DBMOD = 5 when I start AutoCAD  (Read 18111 times)

0 Members and 1 Guest are viewing this topic.

BlackBox

  • King Gator
  • Posts: 3770
Re: DBMOD = 5 when I start AutoCAD
« Reply #15 on: August 10, 2011, 01:57:33 PM »
I'm running/loading a few things in S::Startup but that's between the PUSH/POP... I didn't think that would make a difference.  Maybe it does??

... (S::STARTUP) loads AFTER the (acad-pop-dbmod) at the end of ACAD.lsp

Also, the list above neglects this, but any .SCR file launched by your icon's startup switch loads AFTER (S::STARTUP).
"How we think determines what we do, and what we do determines what we get."

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: DBMOD = 5 when I start AutoCAD
« Reply #16 on: August 10, 2011, 02:00:52 PM »
I'm running/loading a few things in S::Startup but that's between the PUSH/POP... I didn't think that would make a difference.  Maybe it does??

... (S::STARTUP) loads AFTER the (acad-pop-dbmod) at the end of ACAD.lsp

Also, the list above neglects this, but any .SCR file launched by your icon's startup switch loads AFTER (S::STARTUP).
Even though it's nestled snug between PUSH & POP?

*stands with hands on hips*  Well that makes no doggone sense.  Hmmpphh!!!
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: DBMOD = 5 when I start AutoCAD
« Reply #17 on: August 10, 2011, 02:01:12 PM »
Wait, so what does the push/pop do?

Effectively starts/stops the counter that records the number of modifications to the drawing:

Quote from: VLIDE Help Docs
acad-push-dbmod

Stores the current value of the DBMOD system variable

(acad-push-dbmod)

This function is used with acad-pop-dbmod to control the DBMOD system variable. You can use this function to change a drawing without changing the DBMOD system variable. The DBMOD system variable tracks changes to a drawing and triggers save-drawing queries.

This function is implemented in acapp.arx, which is loaded by default. This function pushes the current value of the DBMOD system variable onto an internal stack. To use acad-push-dbmod and acad-pop-dbmod, precede operations with acad-push-dbmod and then use acad-pop-dbmod to restore the original value of the DBMOD system variable.

Return Values

Always returns T.

Quote from: VLIDE Help Docs
acad-pop-dbmod

Restores the value of the DBMOD system variable to the value that was most recently stored with acad-push-dbmod

(acad-pop-dbmod)

This function is used with acad-push-dbmod to control the DBMOD system variable. The DBMOD system variable tracks changes to a drawing and triggers save-drawing queries.

This function is implemented in acapp.arx, which is loaded by default. This function pops the current value of the DBMOD system variable off an internal stack.

Return Values

Returns T if successful; otherwise, if the stack is empty, returns nil.
« Last Edit: August 10, 2011, 02:04:18 PM by Lee Mac »

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: DBMOD = 5 when I start AutoCAD
« Reply #18 on: August 10, 2011, 02:03:54 PM »
Wait, so what does the push/pop do?

Effectively starts/stops the counter that records the number of modifications to the drawing:

Quote from: VLIDE Help Docs
acad-push-dbmod

Stores the current value of the DBMOD system variable

(acad-push-dbmod)

This function is used with acad-pop-dbmod to control the DBMOD system variable. You can use this function to change a drawing without changing the DBMOD system variable. The DBMOD system variable tracks changes to a drawing and triggers save-drawing queries.

This function is implemented in acapp.arx, which is loaded by default. This function pushes the current value of the DBMOD system variable onto an internal stack. To use acad-push-dbmod and acad-pop-dbmod, precede operations with acad-push-dbmod and then use acad-pop-dbmod to restore the original value of the DBMOD system variable.

Return Values

Always returns T.

Quote from: VLIDE Help Docs
acad-pop-dbmod

Restores the value of the DBMOD system variable to the value that was most recently stored with acad-push-dbmod

(acad-pop-dbmod)

This function is used with acad-push-dbmod to control the DBMOD system variable. The DBMOD system variable tracks changes to a drawing and triggers save-drawing queries.

This function is implemented in acapp.arx, which is loaded by default. This function pops the current value of the DBMOD system variable off an internal stack.

Return Values

Returns T if successful; otherwise, if the stack is empty, returns nil.
Well damn, I guess I could have been a little less lazy and looked it up myself. Thanks.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

BlackBox

  • King Gator
  • Posts: 3770
Re: DBMOD = 5 when I start AutoCAD
« Reply #19 on: August 10, 2011, 02:07:03 PM »
I'm running/loading a few things in S::Startup but that's between the PUSH/POP... I didn't think that would make a difference.  Maybe it does??

... (S::STARTUP) loads AFTER the (acad-pop-dbmod) at the end of ACAD.lsp

Also, the list above neglects this, but any .SCR file launched by your icon's startup switch loads AFTER (S::STARTUP).
Even though it's nestled snug between PUSH & POP?

*stands with hands on hips*  Well that makes no doggone sense.  Hmmpphh!!!

Correct, during ACAD.lsp you're simply adding items to BE loaded/executed during (S::STARTUP).

Instead, is it possible for you to simply load/execute the code in ACAD.lsp, or ACADDOC.lsp?

As I said, I also use both ACAD.lsp and ACADDOC.lsp at startup and open Drawing1 DBMOD = 0.

FWIW - You don't need to use Push/Pop to startup without a save prompt... you can use this instead:

Code: [Select]
(defun c:FOO ()
  "FOO")

(if (= 1 (getvar 'dwgtitled))
  (c:FOO))

(princ)

... That way, any DEFUNs you add are still able to be called, but will not cause Drawing1 to prompt for save. Just a thought.
"How we think determines what we do, and what we do determines what we get."

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: DBMOD = 5 when I start AutoCAD
« Reply #20 on: August 11, 2011, 09:19:10 AM »
You could of course simply place the pop at the end of the S::Startup to have it run as late as possible. Of course if anything else appends onto the S::Startup as well that will get run after the pop. The /b switch only runs once per session though, so if you open another DWG all the usual suspects gets run again, without running the script.

This is a particularly prickly nettle! Even going through stuff like reactors can but make for more headaches. The "best" solution is not to change stuff inside the DWG through your startup routines, rather fix your templates correctly and run a script on existing files once and for all.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.