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.
... 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:
[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 CetStandards (/ ...)
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:
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.