AutoCAD/grid off by default

Advertisement


Question
I was wondering if there is a way to have the grid off when you startup Autocad?  I hit F7 to turn it off, would be nice if it was off by default. I am using Autocad 2012 full version.

Thanks
Kevin

Answer
You can create a template drawing file (.dwt) with all the settings your heart desires and have AutoCAD use that to start new drawings.  (See Options; Files; Template Settings; Drawing Template File Name for QNEW.

Another way is to create a text file by the name of ACAD.LSP.  You can do that with notepad.  Make five line of text as follows:

(defun startup ()
   (setvar "gridmode" 0)
   (princ)
)
(startup)

The first four define a function.  the fifth line executes the new function.  This is very basic LISP.  The princ function (in this case) gives you a clean finish that won't display "nil" when you finish the function.  More code can be added for other settings if desired, such as turning off object snap mode and ortho mode.

(defun startup ()
   (setvar "gridmode" 0)
   (setvar "osmode" 0)
   (setvar "orthomode" 0)
   (princ)
)
(startup)

After you create ACAD.LSP put it in the Support File Search Path, or better yet, create a new folder for your LISP files.  Don't put it as a subfolder of an Autodesk AutoCAD or vertical program folder.  That way you can have your acad.lsp and future lisp files in your own special folder and they will not be removed accidentally if you upgrade your AutoCAD and delete an old version.  Then add the new folder to the Support File Search Path (Options; Files; Support File Search Path; Add)  The set ACADLSPASDOC to 1 (you should never again have to set that system variable.)  To check a LISP file, I recommend that you set *error* to nil.  Do so by typing (setq *error* nil).  Then AutoCAD will return "nil".  When you edit or create a LISP file, you can load the code it contains with the "load" lisp function.  For acad.lsp just type (load "acad") at the command line.  
So, there's your lesson number one in LISP, and it's also a great way to build up a drawing system variables that will set themselves every time you open a drawing and start a new one.

Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bill DeShawn

Expertise

I can address all 2-D questions and some 3-D questions. I do programming in AutoLISP if it doesn`t involve solid modeling. I can also address menu customization issues and can help you find answers to questions I can`t answer by taking your question directly to Autodesk via their newsgroups.

Experience

I used to do electronic and mechanical design for a flat panel monitor manufacturer, and now I do architectural drafting for an architect. I did and do AutoLISP and menu customization and take pride in making my lisp routines to do the work exactly the way the client likes them done.

Publications
I had a routine published in CADENCE magazine (no longer in publication and taken over by CADALYST). Some of my routines are published on my website at http://my.sterling.net/~bdeshawn

©2012 About.com, a part of The New York Times Company. All rights reserved.