CADTutor: The best free help for AutoCAD on the web

AutoCAD FAQ

Knowledgebase Home | Glossary | Favorites | Login Knowledgebase Home | Glossary | Favorites | Login

How do I automatically load variables?

Article Details

Last Updated
3rd o May, 2009

Original Author
Alan Cullen

User Opinions (2 votes)
100% thumbs up 0% thumbs down

How would you rate this answer?
Helpful
Not helpful

Automatic loading of variables is achieved using the acaddoc.lsp file. AutoCad reads this file every time a drawing is opened.

Find this file by typing on the command line: (findfile "acaddoc.lsp") .

  • If the file exists, the path to it will be returned. Open the file using a suitable text editor, and edit the file as outlined below.
  • If the file does not exist, then create it by starting a new file in a suitable text editor, such as Windows Notepad, and edit the new file as outlined below.

For each variable that is to be included for automatic loading, add a line to the file using the following format:

(setvar "variablename" variablevalue)

Where:
"variablename" =  the name of the variable required.
variablevalue =  the required value of that variable.

e.g.
(setvar "luprec" 3)

Save the file as acaddoc.lsp in the support folder under the AutoCad installation folder:
C:\Program Files\AutoCAD version\Support

Lisp routines can also be included in the acaddoc.lsp file so they can also load automatically when a drawing is opened.

Add the following line to the acaddoc.lsp file to automatically load a lisp routine:

(load "C:/lispfolder/lispname.lsp")

Use a forward slash for folder separation/path.

Variables can also be set up in the AutoCad drawing template file (acad.dwt) so they will load automatically when a new drawing is opened.

Visitor Comments

  1. Comment #1 (Posted by R.K. McSwain )
    1. You can use a forward slash or two backslashes ("/" or "\\") 2. Only drawing saved variables can be saved in the template drawing. Where a variable is saved is documented in the Command Reference. 3. Note that if you change drawing saved variables at startup, DBMOD will not be zero (0). This will cause you to get prompted to save changes in an otherwise unaltered drawing. (Under Consideration for inclusion-Tiger-080329)

Post Comment for "How do I automatically load variables?"

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Your Name:
   Email Address:
* Your Comment:
* Enter the code below:
 

Related Articles

Attachments

No attachments were found.

Continue
Creative Commons Licence
Powered by Interspire Knowledge Manager