How to Create and Load a Startup LISP Routine

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

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

FILEDIA 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 15 days
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

______
icon-svg-close-thick

Cookie preferences

Your privacy is important to us and so is an optimal experience. To help us customize information and build applications, we collect data about your use of this site.

May we collect and use your data?

Learn more about the Third Party Services we use and our Privacy Statement.

Strictly necessary – required for our site to work and to provide services to you

These cookies allow us to record your preferences or login information, respond to your requests or fulfill items in your shopping cart.

Improve your experience – allows us to show you what is relevant to you

These cookies enable us to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we use to deliver information and experiences tailored to you. If you do not allow these cookies, some or all of these services may not be available for you.

Customize your advertising – permits us to offer targeted advertising to you

These cookies collect data about you based on your activities and interests in order to show you relevant ads and to track effectiveness. By collecting this data, the ads you see will be more tailored to your interests. If you do not allow these cookies, you will experience less targeted advertising.

icon-svg-close-thick

THIRD PARTY SERVICES

Learn more about the Third-Party Services we use in each category, and how we use the data we collect from you online.

icon-svg-hide-thick

icon-svg-show-thick

Strictly necessary – required for our site to work and to provide services to you

Qualtrics
W
Akamai mPulse
W
Digital River
W
Dynatrace
W
Khoros
W
Launch Darkly
W
New Relic
W
Salesforce Live Agent
W
Wistia
W
Tealium
W
Upsellit
W
CJ Affiliates
W
Commission Factory
W
Google Analytics (Strictly Necessary)
W
Typepad Stats
W
Geo Targetly
W
SpeedCurve
W
Qualified
#

icon-svg-hide-thick

icon-svg-show-thick

Improve your experience – allows us to show you what is relevant to you

Google Optimize
W
ClickTale
W
OneSignal
W
Optimizely
W
Amplitude
W
Snowplow
W
UserVoice
W
Clearbit
#
YouTube
#

icon-svg-hide-thick

icon-svg-show-thick

Customize your advertising – permits us to offer targeted advertising to you

Adobe Analytics
W
Google Analytics (Web Analytics)
W
AdWords
W
Marketo
W
Doubleclick
W
HubSpot
W
Twitter
W
Facebook
W
LinkedIn
W
Yahoo! Japan
W
Naver
W
Quantcast
W
Call Tracking
W
Wunderkind
W
ADC Media
W
AgrantSEM
W
Bidtellect
W
Bing
W
G2Crowd
W
NMPI Display
W
VK
W
Adobe Target
W
Google Analytics (Advertising)
W
Trendkite
W
Hotjar
W
6 Sense
W
Terminus
W
StackAdapt
W
The Trade Desk
W
RollWorks
W

Are you sure you want a less customized experience?

We can access your data only if you select "yes" for the categories on the previous screen. This lets us tailor our marketing so that it's more relevant for you. You can change your settings at any time by visiting our privacy statement

Your experience. Your choice.

We care about your privacy. The data we collect helps us understand how you use our products, what information you might be interested in, and what we can improve to make your engagement with Autodesk more rewarding.

May we collect and use your data to tailor your experience?

Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.