If you didn’t know, CAD Masters does a lot of programming. A long time ago, we wrote a lot of LISP files, nowadays we do a lot of Microsoft .NET programming. Even though we write a lot of our software in .NET, we know that LISP has its place. They are quick and straight to the point, hence why Drew is writing his series on the ACAD.LSP file. Not only that, but there are so many useful free LISP files available on the internet that will do things that AutoCAD just cannot do easily out of the box.
When I first started at CAD Masters I wanted to get a basic understanding of writing LISP files. I found that joining polylines together was a very tedious task and wanted to write a command to join them easier. I ended up creating a pedit join LISP command to learn the basics. The routine that I wrote will grab all the lines, arcs and polylines that touch end to end and join them together in a single click on an object.
Follow these steps to use the LISP file:
- Download the file (Right-click Save as or Save link as)
- Rename the file extension to (.lsp).
- Open AutoCAD.
- Type AP for APPLOAD at the command line.
- Select the file
- Click Load.
- Click Close.
- Type PEJ at the command line.
- Select a line that is adjacent to other lines and arcs, they are joined!
Take a look at the contents of the file in Notepad++, and consider how you might do something similar to make a repetitive or tedious task easier.