How to Create and Load a Startup LISP Routine

LISP routine

As I started to use AutoCAD day in and day out (many years ago, wink), I found that sometimes I would run commands or set system or drawing variables many times throughout the day. Let’s take a look at some of these commands/variables, and then we will discuss how to automate running them any time you open a drawing with a LISP routine.

The list below explains some of these commands and system variables in detail that are used to write LISP routines.

VTENABLE Command: Transitioning Between AutoCAD views

VTENABLE is a system variable that makes AutoCAD transition between views smoothly or abruptly. The variable can be set to a value of 0-7; I recommend you set it to 1. Setting the variable to 1 will allow you to zoom/pan and “see” where your zooming from/to. Although this is a system variable, and should only need to be set once, I have found that sometimes the variable can switch to zero when you exit or crash.

PEDITACCEPT Command: Polyline Edits

When running the PEDIT command (Polyline Edit), and you select a line or an arc, AutoCAD will prompt you to turn the object into a polyline.

In most cases you want to turn the object into a polyline anyway, and the prompt is an “extra step.” Setting the system variable PEDITACCEPT to 1 will bypass the prompt and turns the object into a polyline automatically.



The PROXYGRAPHICS drawing variable is used to tell the drawing to save images of proxy objects (e.g., Civil 3D objects, Architecture toolset objects, etc.). It is also used with those products for specific functionality. In most cases you want this variable to be set to 1, and since it is a drawing variable, you will need to set this to 1 for every drawing.

MSLTSCALE Command: Change Linetypes Variables

Standing for both Model Space LTSCALE and Paper Space LTSCALE, these are drawing variables. The MSLTSCALE variable controls the linetype display when in model space. When you change the annotation scale, with MSLTSCALE set to 1, your linetypes will scale with the annotation scale. Set to 0, they will show at 1:1. I recommend setting this variable to 1.

FILEDIA Command: File Operations

The notorious FILEDIA variable can cause you to yell at your computer, have chest pains, and make you want to quit for the day. This variable sometimes gets set to 0, causing you to get prompted to actually type in the location for any file operation (e.g., Open, Save As, etc.).

Once you realize that you simply need to set FILEDIA to 1, you want this variable to be set automatically, every time you open AutoCAD……….which leads us to the next section, “How do you setup a startup LISP routine that will run every time you open AutoCAD?”


How to Create a Startup LISP Routine

Creating a startup LISP routine couldn’t be easier. Simply create a new text file in a location that you will not change. Then, to get these commands to run, you simply use the LISP function “command” like so:

(command “<VARIABLE_NAME>” “<SETTING>”)

Below is how you would type in all the variables outlined in this article:

(command “VTENABLE” “1”)
(command “PEDITACCEPT” “1”)
(command “PROXYGRAPHICS” “1”)
(command “MSLTSCALE” “1”)
(command “FILEDIA” “1”)

Now, save the file and move onto the next step.

Loading Your LISP Routine With Every Drawing

To have your startup LISP file load every time a drawing is open is also very simple. All you have to do is type CUI in the command line. Next, find the LISP Files category in the Customization in All Files section of the CUI dialog box, right-click on it, and choose Load Lisp from the context menu.

LISP Files AutoCAD

Navigate to the location of where your LISP file is, and it will appear in the list.

LISP Files AutoCAD

And that’s how you write and load a startup LISP routine. Remember, if you find other variables or commands that you would like to run every time you open a drawing, simply add them to the startup .LSP file.

Try AutoCAD free for 30 days

Add comment

There are no comments

The AutoCAD Blog is all about helping you get the most out of AutoCAD. It's also the best way for you to connect with the makers of AutoCAD. Subscribe to keep up with AutoCAD