Author Topic: Lisp and startups  (Read 2554 times)

0 Members and 1 Guest are viewing this topic.

Viktor

  • Guest
Lisp and startups
« on: October 30, 2008, 07:09:59 PM »
I don't lisp much, only enough to execute vb stuff. So my question is this:

If I have a lisp routine that is in my appload\contents, so it is loaded on startup, is this lisp routine executed every time a new drawing is opened? so s::startup is triggered on every startup, correct?

If this is true, and in my startup routine I have a section where I vl-file-copy a bunch of files from the network to the local drive, does this mean that these files are copied down everytime a files is opened?

If so, is there a way to prevent this, maybe only trigger on startup of application?

Thanks,
Viktor.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Lisp and startups
« Reply #1 on: October 30, 2008, 07:16:38 PM »
They do run with every opened drawing. You could add the /b switch in your acad shortcut and point it to a script file that launches the routine only on acad startup.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

uncoolperson

  • Guest
Re: Lisp and startups
« Reply #2 on: October 30, 2008, 07:22:12 PM »
is ACADLSPASDOC what you are looking for?

Viktor

  • Guest
Re: Lisp and startups
« Reply #3 on: November 03, 2008, 01:26:03 PM »
yea, my problem is that we distribute all of our functions via one lisp routine added to the contents of the appload command. We do not utilize acad.lsp for startups. And there's a portion of the startup code that I do want to have run on every document, but a portion I don't.

Is there a way to check if autocad is starting up fresh or just opening another drawing?

Thanks,
Viktor.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Lisp and startups
« Reply #4 on: November 03, 2008, 02:04:04 PM »
You can set a global variable through the Acad session, and just check to see if it's set.  If not, then run the code.  Look at 'vl-propagate'.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Viktor

  • Guest
Re: Lisp and startups
« Reply #5 on: November 05, 2008, 06:54:50 PM »
You can set a global variable through the Acad session, and just check to see if it's set.  If not, then run the code.  Look at 'vl-propagate'.
This is going to work. Thanks Willey.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Lisp and startups
« Reply #6 on: November 05, 2008, 06:59:31 PM »
You can set a global variable through the Acad session, and just check to see if it's set.  If not, then run the code.  Look at 'vl-propagate'.
This is going to work. Thanks Willey.
You're welcome.  Just make sure the global variable isn't something simple that some random code could overwrite.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Lisp and startups
« Reply #7 on: November 05, 2008, 08:05:38 PM »
Quote from: Viktor
If so, is there a way to prevent this, maybe only trigger on startup of application?


Assuming ACADLSPASDOC = 0 (the default value), then "Acad.lsp" is only loaded at application startup.