[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Manage System Variable Settings
Tip# 3866 By Danny Korem On 16-Apr-2012
0
Rated By 0 users
Categories : Programming Examples
Software type : AutoCAD 2013
Rename File To : No Files to download.
Adjust setvars, system parameters that are saved in the software program.

Frequent tipster Danny Korem shares his method of managing system variable settings in AutoCAD.

"We are familiar with different kinds of parameters saved within files (DWG, DWG) and saved within the system. Some examples are layers and their properties, styles of all kinds, layouts including intelligent title blocks, and so forth. All of these reside within files (DWG or DWG). Since prototyping deals with additional parameters, we must be creative. If I would like a group of users to share standard workspaces and mutual settings, I must approach it in a number of ways.

"Today, I'll deal with setvars. These system parameters are saved within the software program, and remain stable until their values are altered again. The screenshot below shows my choice of object snap settings.



"Some users are aware of the numeric reflection of this combination, a setvar called Osmode. You can try this combination of object snap settings, and then type osmode on the Command line. The value you'll get is 255 — a sum of values of each snap setting.

"Every time you start AutoCAD, many parameters are loaded from a file called acad2012doc.lsp. At a multi-user practice, a shared-public acad2012doc.lsp file will force all sessions of AutoCAD to behave in an identical manner. Here is a look at this example as reflected within the file."



Notes from Cadalyst Tip Reviewer Brian Benton: AutoCAD loads two files that can contain system variable (setvars) settings in them: acad.lsp and acaddoc.lsp. Neither of these files is provided with AutoCAD, but there are acad2012.lsp and acad2012doc.lsp (note the 2012). These version-specific files should not be altered, as they contain release-specific information; changing them could affect the way AutoCAD functions. Instead, use Windows Notepad or some other text editor to create your own acad.lsp or acaddoc.lsp file, and place it in AutoCAD's Support folder.

AutoCAD loads the contents of acad.lsp only once, when it starts. However, acaddoc.lsp is loaded every time a file is opened in AutoCAD. You can set it so that AutoCAD loads acad.lsp every time you open a file by changing the cadlspasdoca setting. These files can contain system variables to set up the UCS, osnap settings (as described in this tip), limits, or any setvar setting that AutoCAD has. It's a great way to make sure AutoCAD starts off properly.

I set the Filedia setvar to 1. When AutoCAD crashes, Filedia often gets set to 0 (zero) when this happens. When I start AutoCAD, this variable will be set properly.

 

Average Rating:
0


User comments
Comment by Cooper,Kent
Posted on 2012-04-16 16:46:02
I believe a System Variable name has gotten its first letter moved to the end, somehow, in the Notes from Cadalyst Tip Reviewer. The System Variable to set for whether ADAD.lsp loads with every drawing is called ACADLSPASDOC [0 for once per AutoCAD session, 1 for every drawing].
Comment by Cooper,Kent
Posted on 2012-04-16 16:47:46
[Unfortunate to find an error in my message correcting an error.... Make that ACAD.lsp.]