How to Create and Load a Startup LISP Routine

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

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

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.

PEDITACCEPT AutoCAD

PROXYGRAPHICS

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

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

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

FILEDIA 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.

The post How to Create and Load a Startup LISP Routine appeared first on AutoCAD Blog.

Previous Article
Divide and Measure in AutoCAD: Tuesday Tips With Frank
Divide and Measure in AutoCAD: Tuesday Tips With Frank

AutoCAD has several commands that I like to refer to as “kissing cousins”. No, I’m not talking about the El...

Recommended For You
How to Fix Problematic Drawings and Crashes: Tuesday Tips With Frank
How to Fix Problematic Drawings and Crashes: Tuesday Tips With Frank

Wouldn’t it be nice if everything in life was always rainbows and unicorns? Sometimes though, things just g...