Using AutoLISP Files in AutoCAD
by Jeff Weber
I started using AutoCAD way back on version 12 and like many users I was always looking for a way to make myself more efficient and utilize AutoCAD to its fullest potential.
I would venture that most AutoCAD users reading this have fit into the same category as the above statement; otherwise you would not be reading the monthly tips.
Most people are here looking for something that will help them do there jobs as efficiently as possible.
In my very first searches, way back on version 12, I kept running into these things called AutoLISP files.
Now there are a lot of users that may have no idea what a lisp file.
Basically an AutoLISP file is an ASCII text file that contains LISP program code.
Autodesk has built some AutoLISP files right into the AutoCAD program so you do not even have to load them. They are loaded automatically when you start AutoCAD.
What I have found over the years is that the end user (you and me) can determine what AutoLISP files get embedded as part of AutoCAD.
For instance, I can remember when commands like TXT2MTXT (convert text to mtext), TCOUNT (automatic numbering) and JOIN (this used to be called "Glue") used to be AutoLISP files that had to be loaded.
In the earlier versions of AutoCAD one time they had to be loaded each time you opened AutoCAD. Now AutoCAD has them as legitimate commands within it's program structure.
Manufacturers also utilize LISP files.
For instance there is a popular molded millwork company that has a program that you can install and it works within AutoCAD.
All you have to do is open AutoCAD and initiate the command that opens their program.
Once this is done the AutoLISP file opens up a dialogue box where you get to preview their drawings of door and window surrounds, arches, columns, etc.
You can then select the one you like and use it within your drawing.
There are other types of user customized programming that can be done in AutoCAD to simplify repetitive tasks, but for now I'm just going to address LISP routines.
Now, I am not a programmer. I have opened several LISP files just to take a look at what it would take to write one. Suffice to say, I quickly decided to leave the AutoLISP programming to the experts.
If I am looking for a file to do something specific, I will get on the internet and do a search. Google is pretty smart and usually narrows down what I need without too much hassle.
There are many, many, many AutoLISP files out there.
Most of them do things that AutoCAD already does but with a little twist, or, the programmer has found a way to make it work just a little more efficiently.
The programmer will usually tell you a little about the AutoLISP program and what it is intended to do in a separate text file, or at the top of the lisp routine code.
You can open up a .LSP file using a simple text editor program. Have a look at the top text of the routine, and you should have a basic idea of what it does or at least the command name to type in AutoCAD once you have loaded the LISP code.
If you find one you like, or you think you might like to try, this is how you load it into your AutoCAD session.
How to Load a LISP Routine
I believe the easiest way to load an AutoLISP file is by using the "APPLOAD" command.
Type APPLOAD on the command line and hit enter.
The Load/Unload Application dialogue box opens up.
Since we are just dealing with LISP files let's change the "Files of Type" box to just show us .LSP files.
When you do this you will probably notice that the default folder does not contain any .LSP files.
If you have downloaded a .LSP file just navigate to that folder, select your .LSP file and hit load. I find it easiest to keep all my AutoLISP routines in the Support sub-directory of the AutoCAD folder.
Next, type the name of the LISP file at the command prompt and it should launch your routine. If it is an older LISP routine that you found on the net, you may find it may not work with a newer version of AutoCAD. I have found that approximately 3 out of 4 of the routines I come across do in fact work, so hopefully yours will too.
That's it; pretty simple.
Now if you want to load it automatically every time you start AutoCAD, you will have to place it in the "Startup Suite".
This is the little briefcase in the lower right hand corner of the Load/Unload Application dialogue box.
Click on "Contents".
Then click on "Add" and navigate to the folder where the .LSP file is located.
Click "Add" then "Add" again and then "Close".
Now your .LSP file will be loaded each time you open AutoCAD.