Hi
this is a question out of the batch-family "run script from lisp / run lisp from script / run script from script / run lisp from lisp" ...
The first, common question is:
Who knows an info / link / doc which describes the basic behaviour and possibilities of these features?
The second, detailed questions is:
How to
"open a batch of DWGs and run a defined lisp ("sub.lsp") and close the DWGs" from a lisp ("main.lsp")?
My current ideas / answers are:
a) Create and run a script:
"main.lsp" creates and writes a script like: "open test.dwg (load "sub.lsp") sub qsave close test.dwg"
Then I have "(command "script" "myscript.scr")
This could work, but I don't have control over a script which could crash or hang or ....
b) Use Starting-group
I use the starting-group (is this the right name in English?) where I add my "sub.lsp" which starts immediately when the DWG will be opened.
In "main.lsp" I use "(command open test.dwg)" to open the DWG which starts the lisp.
c) ObjectDBX:
The "sub.lsp" (there are many of it ...) should also be used within AutoCAD and this is why the code should be the same without optimization for ObjectDBX.
d) Others
I also use OpenDCL and DosLib on a low level (and don't know all commands at the moment), but it would be fine to have commands like:
open test.dwg
start sub.lsp inside test.dwg
close test.dwg
This ( d) ) would be perfect ...
Any help would be appreciated
EDIT:
Here is a solution with VBA (from the year 2007), but VBA is nearly dead ...
Execute commands on all open drawings