LISP Files

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:

  1. Download the file (Right-click Save as or Save link as)
  2. Rename the file extension to (.lsp).
  3. Open AutoCAD.
  4. Type AP for APPLOAD at the command line.
  5. Select the file
  6. Click Load.
  7. Click Close.
  8. Type PEJ at the command line.
  9. 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.

Similar Posts