LISP code automate set of Autocad comment or process

LISP code automate set of Autocad comment or process

ajithsingh18
Participant Participant
289 Views
1 Reply
Message 1 of 2

LISP code automate set of Autocad comment or process

ajithsingh18
Participant
Participant

I have a set of processes that I need to automate using LISP. (Scale uniformity to yes, Unit precision to 0.00, Purge all checked items , Zoom extent the drawing)

 

To open a drawing file from a folder, navigate to the desired folder and locate the file. Then, select the file to open it. To access the block editor, choose the "current drawing" option. Once inside the block editor, set the block property scale uniformity to "YES". Furthermore, please set the unit precision to two decimal places in order to ensure accurate measurements. After that, kindly save and close the block editor page. Next, proceed to purge the drawing sheet purge all checked items and zoom to the extent of the drawing. Finally, save and close the drawing file.

0 Likes
290 Views
1 Reply
Reply (1)
Message 2 of 2

paullimapa
Mentor
Mentor

I've attached Block_Scale_Uniform.lsp which will take care of current dwg scale uniform setting

You'll need to save this in one of AutoCAD Support File Search Path & Trusted Locations: (Options>Files).

Then to load it at command line enter:

(load"Block_Scale_Uniform")

and run it by entering command:

Block_Scale_Uniform

As for unit precision again at command line enter:

_.LUPREC 2

For purging everything at command line enter:

_.-PURGE _ALL * _No

Lastly:

_.ZOOM _E

Now to run the above on all drawings in a folder you can use Lee Mac's Script Writer:

Script Writer | Lee Mac Programming (lee-mac.com)

On Script Line enter sequence as provided above:

_.Open *file* (load"Block_Scale_Uniform") Block_Scale_Uniform _.LUPREC 2 _.-PURGE _ALL * _No _.ZOOM _E _.Qsave _.Close


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes