Jump to content

How to Create and Load a Startup LISP Routine


The AutoCAD Blog

Recommended Posts

The AutoCAD Blog

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.

C3D3Bh9M2rs

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...