executing code on startup (AGAIN)

executing code on startup (AGAIN)

Anonymous
Not applicable
290 Views
4 Replies
Message 1 of 5

executing code on startup (AGAIN)

Anonymous
Not applicable
I have looked at old posts and read this in acad literature but I am still lost.

i put the following code in acad2000.lsp but this appears to run everytime i load a new drawing. my understanding is that acad2000.lsp runs at startup only and acad2000doc.lsp runs each time a file is loaded. any pointers?

(defun S::STARTUP()
(command "_-vbarun" "MakeMenu")
)
0 Likes
291 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Make a file named acad.lsp and add the following:

(vl-load-com)
(vl-vbarun "MakeMenu")

Then in the System tab under Options make sure the "Load acad.lsp
with every drawing" checkbox is unchecked. If you haven't already
read the comparing acad.lsp files, go to:

http://www3.autodesk.com/adsk/support/techdoc/0,,91014--125452-0_218
38,00.html

Watch out for line wrap on the url.

I haven't actually tried this but it should work.

Good luck - Tom

bmorris137 wrote in message
news:[email protected]...
> I have looked at old posts and read this in acad literature but I
am still lost.
>
> i put the following code in acad2000.lsp but this appears to run
everytime i load a new drawing. my understanding is that
acad2000.lsp runs at startup only and acad2000doc.lsp runs each time
a file is loaded. any pointers?
>
> (defun S::STARTUP()
> (command "_-vbarun" "MakeMenu")
> )
0 Likes
Message 3 of 5

Anonymous
Not applicable
Perfect, Tom. Thank you for that reference. I have kept my existing lisp code though. I know nothing about lisp. could you tell me what the difference it in the lisp you suggested?

once again thanks for the info.
Bill Morris
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi Bill,

I'm an IS guy so I'm not very knowledgeable re Acad inner workings.
Hopefully Frank O or one of the other guys will pop in and explain
how the vl stuff works. I'm assuming that you want the MakeMenu
project to only run once on initial Acad load, not on opening
another dwg. I think the code I showed does that. Maybe one of the
other guys can confirm it or provide you with the correct code.

- Tom

bmorris137 wrote in message
news:[email protected]...
> Perfect, Tom. Thank you for that reference. I have kept my
existing lisp code though. I know nothing about lisp. could you
tell me what the difference it in the lisp you suggested?
>
> once again thanks for the info.
> Bill Morris
0 Likes
Message 5 of 5

Anonymous
Not applicable
Hello,
Back in R12 Autodesk got tired of us putting our code in their acad.lsp, so
they made a new autoloader acadr12.lsp for Autodesk's code and left acad.lsp
blank for users to use. This has carried through R13, R14, & now 2000.
Now, in addition to having a user defined autoloader for AutoCAD startup
(acad.lsp) their is a userdefined autoloader for every document open!
(acaddoc.lsp). Now users can have whatever they want without editting the
"builtin" acad2000.lsp.

Denton Yoder

bmorris137 wrote in message
news:[email protected]...
> Perfect, Tom. Thank you for that reference. I have kept my existing lisp
code though. I know nothing about lisp. could you tell me what the
difference it in the lisp you suggested?
>
> once again thanks for the info.
> Bill Morris
0 Likes