Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

starting autocad/acad with extra attributes (from command prompt)

2 REPLIES 2
Reply
Message 1 of 3
miroslav.karpis
319 Views, 2 Replies

starting autocad/acad with extra attributes (from command prompt)

Hi, please what are the attributes I can pass when I open acad from command prompt? Basically I would like to open AutoCad from command line with a lisp program as a parameter. After the acad is open the lisp program should be loaded and executed. Everyting automatic, without user-input.

 

Is that possible?

 

Thanks,..... 

2 REPLIES 2
Message 2 of 3


@miroslav.karpis wrote:

... I would like to open AutoCad from command line with a lisp program as a parameter. After the acad is open the lisp program should be loaded and executed. Everyting automatic, without user-input.

 

Is that possible?

..... 


Look into the use of acad.lsp and/or acaddoc.lsp files.  Something that is loaded by the former will happen only when AutoCAD is first opened, and something that is loaded by the latter will happen in every drawing that is opened.  There are many examples on this forum [search for those file names].

 

Essentially, if the Lisp program you want to load and execute is called DoYourThing.lsp, you would have an entry in one of those files that looks like this:
 

(load "DoYourThing")

[You can include the .lsp at the end of the file name if you want, but it's not necessary.]

 

If the things that it does are just spelled out in DoYourThing.lsp, without the "wrapper" of a definition of a Command name to run them, then that's all you need to do -- they will be done when it loads.  If there is a definition of a Command in it that spells out what to do, for instance the top of it looks something like this:

 

(defun C:SetStandards (/ ...)

 

then after the (load) function in the acad.lsp or acaddoc.lsp file, you would need another line to run what's in that Command:

 

(C:SetStandards)

 

Or, you could put that last line into the end of the DoYourThing.lsp file, after the closing right parenthesis for the (defun) function, and it will "run itself" when it loads.

Kent Cooper, AIA
Message 3 of 3
M_Hensley
in reply to: miroslav.karpis

You can use the command line switch /b to launch a script file. Just create a script that loads your lisp file.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost