@dvir860 wrote:
I have a lisp that makes save, zip, close the file.
Is there a possibility that it will Lisp but will work on all open files Autocad (the same principle of commands closeall and saveall)?
The lisp:
(DEFUN c:etra ()
(command "_qsave")
(command "_etransmit"
"_c"
(strcat (getvar "dwgprefix")
(substr (getvar "dwgname")
1
(- (strlen (getvar "dwgname")) 3)
)
"ZIP"
)
)
(command "_close")
)
(etra)
Hello dvir860,
I would suggest to use a '*.scr' file to call your 'etra'...
You'll have to change your code, the (etra) will not call your function...
Change (etra) to (c:etra)
Quick and dirty...
(vl-load-com)
(defun c:demo (/ acadobj adoc dwglst ofile scrfile)
(c:saveall)
(setq acadobj (vlax-get-acad-object)
adoc (vla-get-activedocument acadobj)
)
(vlax-for doc (vla-get-documents acadobj)
(if (not (equal adoc doc))
(progn
(setq dwglst (cons (vla-get-fullname doc) dwglst))
(vla-close doc)
)
)
)
(setq scrfile (strcat (getenv "Temp") "\\My_Script.scr")
ofile (open scrfile "w")
)
(foreach dwg dwglst
(write-line (strcat "_.open\r" (chr 34) dwg (chr 34) "\r") ofile)
(write-line
(strcat "(load " (chr 34) "c:/your/path/etra.lsp" (chr 34) ")\r")
ofile
)
)
(close ofile)
(command "_.script" scrfile)
(vla-sendcommand adoc (strcat "(load " (chr 34) "c:/your/path/etra.lsp" (chr 34) ")\r"))
)
Change the "c:/your/path/etra.lsp" to the correct path...
Hope this helps,
Henrique