I have hundreds of drawings I want to run through scriptpro with a script calling 3 different lisp routines. I have the 3 lisps working independantly but can't figure out how to get them to all run in one script. Is this even possible?
Two of the Lisps are for redefining the title block in 2 different types of drawings that have different title blocks. The last lisp locks all viewports in all windows. I'll attach the 3 lisps I'm trying to merge in the script. I am not very versed in scripts and lisps so I'm guessing at least 2 of these lisps could be merged into a single lisp...I just don't know how. Thanks for any help.
Here is what I have for the script file contents (which doesn't work):
(load "redefine100")
(load "redefine102")
(load "vlocker")
qsave
@david.augspurger wrote:I have hundreds of drawings I want to run through scriptpro with a script calling 3 different lisp routines. I have the 3 lisps working independantly but can't figure out how to get them to all run in one script. Is this even possible?
Two of the Lisps are for redefining the title block in 2 different types of drawings that have different title blocks. The last lisp locks all viewports in all windows. I'll attach the 3 lisps I'm trying to merge in the script. I am not very versed in scripts and lisps so I'm guessing at least 2 of these lisps could be merged into a single lisp...I just don't know how. Thanks for any help.
Here is what I have for the script file contents (which doesn't work):
(command "_.insert" "icn-bs4=icn-bs4")
(command); cancels the insert command but cancels the script too
Exactly, The way your routine is written not only it will cancel the "insert" command, it will cancel the script as well
Try this instead
(defun BLKREDEF ( blkname / bn blkname cmde) (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (if (and (tblsearch "block" (vl-filename-base blkname)) (setq bn (findfile blkname))) (progn (vlax-invoke (vlax-get (vla-get-ActiveLayout adoc) 'Block) 'InsertBlock '(0.0 0.0 0.0) bn 1 1 1 0) (entdel (entlast)) (vla-regen aDoc acActiveViewport) (princ (strcat "\nBlock " (strcase (vl-filename-base blkname)) " redefined.")) ) (princ "Block not found.") ) (prin1) )
(BlkRedef "D:\\ThisFolder\\Blocks\\TEST.dwg")
And continue with your Viewport lock routine