How to Create and Load a Startup LISP Routine


By Seth Cohen

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.


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.


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.


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.


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?”


Creating 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 the 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 create 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

Related Articles

Comments Closed

1 comment

  1. Avatar
    Mario Torres

    AutoCAD and its vertical applications are a great concept of a CAD program, it is complete and versatile mainly in regards to customization and programming of macros and Lisp routines, but it has a big problem, its instability. Unfortunately, in execution it presents errors, failures and excessive consumption of RAM which spoil that great concept that makes us fall in love with this great application that I personally use since version 12 and I will continue using it. I would like to me and many users that this topic will be taken into account and that it is optimized and stable as a Microsoft Office application.