CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 2323 
Plex.Earth connects AutoCAD and Google Earth

CAD tip CAD tip # 3088:

Question CAD 
 %  platform  category 
Q - question

How to set the drawing window background color from menu, script or LISP?

A - answer Use the Background AutoCAD environment variable (not system variable) to change model window background color - e.g.:
(SETENV "Background" "1111111")
or (in LT):
_SETENV Background 1111111
and restart your drawing window (e.g. by switching to a layout and back).

Similarly you can change the layout (paperspace) background color with:

(setenv "Layout background" "123456")

Do not forget to specify the color code as a string and type the variable name verbatim as specified above (upper/lowercase).

The color code is calculated as:

(blue * 65536) + (green * 256) + red

You can get the current code by:

(getenv "Background")

100% *  CAD 
9.6.2003    9736×  

Back   All CAD Tips All CAD tips&tricks

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Automatic nesting of 2D parts on rectangular sheets in AutoCAD
AutoNEST 2008 More info

Please use these tips at your own risk.
CAD Studio is not responsible for possible problems that may occur as a result of using any of these tips.