Author Topic: "startup" variable won't reset in lisp  (Read 5694 times)

0 Members and 1 Guest are viewing this topic.

civilman1957

  • Guest
"startup" variable won't reset in lisp
« on: July 28, 2017, 07:35:56 AM »
Good morning,

Good morning,

We created a startup lisp routine some time ago to be called by acaddoc.lsp, and which presets a variety of things - variables such as visretain, savetime, whipthread and so on, as well has default paths for ctb, pmp, and pipe networks.
My problem is this: I recently attempted to add the "startup" system variable and set it to "2", in order to prevent "drawing1" from opening. We exclusively use a .dwt file for both surveying and design work, and have no need for it. However, C3D ignores the variable I've put into the lsp. All the others work perfectly, and change in cad when I change them in the startup.lsp. But "startup" is ignored, no matter where I place it. The code for it is:

(SETVAR "STARTUP" 2)                           ; prevents drawing1 from opening

Can anyone shed any light on this?

Thanks,

Tom

sljohnson

  • Newt
  • Posts: 27
Re: "startup" variable won't reset in lisp
« Reply #1 on: July 28, 2017, 12:33:54 PM »
Morning Tom,

You will probably have a better result if you set the STARTUP variable in ACAD.LSP as it loads (if present) before ACADDOC.lsp in the start up routine.

In the event you didn't know, ACAD.LSP runs once per session, ACADDOC.LSP runs every time a drawing is opened.

My thought would be to use acaddoc.lsp to reset system variables when opening new drawings that a user or other routine tends to alter back to "standard" and acad.lsp to set things for the session and/or that aren't prone to being changed during the session.

Shannon

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: "startup" variable won't reset in lisp
« Reply #2 on: July 28, 2017, 09:37:07 PM »
In the event you didn't know, ACAD.LSP runs once per session, ACADDOC.LSP runs every time a drawing is opened.



Just a note...
This is true, unless you have ACADLSPASDOC = 1, in which case ACAD.LSP loads in every drawing too.
This was added in AutoCAD 2000 to ease the transition from R14, but no idea why it's even still available. No reason to ever set this to 1.

Crank

  • Water Moccasin
  • Posts: 1503
Re: "startup" variable won't reset in lisp
« Reply #3 on: July 29, 2017, 05:13:10 AM »
Startup=2 should work, but it's a registry setting.
I think all lisp is loaded after a drawing is open. So that means that when you change the STARTUP variable you'll notice the result the next time you'll start Autocad.

This is also true for another variable you might consider: (setvar "STARTMODE" 0)
Vault Professional 2023     +     AEC Collection