[Search tip detail and code files using keywords, tip number, author name, etc ]
Set Every System Variable to Your Liking
Tip# 3264 By Jesse Moore On 20-Sep-2009
Rated By 1 users
Categories : Script Files
Software type : AutoCAD 2010
Rename File To : No Files to download.
Creating a basic script will change back system variables that become discombobulated.

Jesse Moore sends us a solution for resetting AutoCAD's system variables the way you want them, every time.

"Have you ever opened a drawing to find that your custom settings are discombobulated? It could be anything under the sun that changed; in my case, it often alters the way I have AutoCAD set up to select objects. You can go into your options and fix it, but the problem really resides in your system variables. So why not make a basic script to change all your system variables back to the way you had them? You're not a programmer, you say? Well, it's easy. "Go to Express>Tools>System Variable Editor (or type in SYSVDLG). (The System Variable Editor lists all of the system variables and also provides a brief description of each one, indicating where it is saved, the value, and other information. Click on the Help button to find out more about it.) Once you've adjusted all the settings (however you choose to do that), run the System Variable Editor, and click on Save All. In the Save As pull-down menu there will be an SCR file (more commonly known as a script file). Name the file, and save it wherever your heart desires. When you want to reset your settings, type in Script on the command line and find that file. All of you tidy people can perform some cleanup on your script file. (What AutoCAD generates will work fine, but it will take a few seconds longer to run.) You can even set up an icon to run the script when you open AutoCAD, but that's a tip for another time."

Notes from Cadalyst Tip Patrol: Another way to make sure your system variables are always set correctly is to set your ACAD.LSP file to run the SCR file you just created, or to place the system variables you want to set into the ACAD.LSP file itself. If you need to work on multiple machines, you can take your SCR file with you on a jump drive, run that file, and set any machine the way you like it.


Average Rating:

User comments
Comment by Beall,Michael
Posted on 2009-09-21 15:32:16
That is a classic tip. I wanted to add that several years ago when I was presenting seminars for Hugh Bathurst, he showed me the routine VARS2SCR. This automatically captures the current variable settings, and you name the resulting .SCR file. This works in A2010, but I haven't confirmed that it captures all the variables. Per Jesse's comment, the resulting script could probably stand to be cleaned up a bit, too.
Comment by Eaton,Nancy
Posted on 2009-09-21 15:46:37
Script files can help with everything from attaching project XREFs to importing pagesetups.
Comment by McSwain,R.K.
Posted on 2009-09-21 16:15:16
It's probably worth noting that if you change variables that are saved in the drawing at startup, then you will get prompted to save the drawing, even if you don't do anything to it. For example, you may open a drawing just to look at it, and then try to close it, and it will prompt you to save. This is usually because a drawing-saved system variable is being changed at startup.