Wednesday, December 13, 2006

Why SmartPurger can batch run AutoLISP files directly

Most batch programs for AutoCAD and its verticals can only run script files (files with the SCR extension). SmartPurger can also run AutoLISP files (files with the LSP, FAS or VLX extension) directly among all other useful things. Here is one reason why it can be useful.

If you want to redefine a block definition without inserting a new block in a drawing you can insert a file using = as this example shows.

(command "insert" "blockname=c:\\path\\filename.dwg"))
(command)

The row (command) cancels the insert command but still the block is updated. But if this is run by the script command (command) stops the script from executing any further. It doesn't help to load a lisp file from the script file. But this can work when running a lisp file using SmartPurger like this sample below. The last to rows are needed for SmartPurger to continue and process the next drawing.

; The name of the block to redefine
(setq blockname "Tag - Metric")
; The path and name to the block use for redefining
(setq blockfile "C:\\temp\\Tag - Metric.dwg")
; Insert the new block and cancel using (command)
(command "insert" (strcat blockname "=" blockfile))
(command)
(command "QSAVE")
(command "_QUIT")

Click here to download the free trial of SmartPurger. It also for the AutoCAD 2007 platform where you might have trouble to get ScriptPro to work. The trial is fully functional except that you can only batch 3 drawings at a time. The fully functional version can be purchased from 25 USD. Since it has ability to close dialog boxes like the one for missing shapes it can almost run forever without interruption.

Technorati tags: ,

No comments:

Post a Comment