CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
CZ | EN | DE
Login or
  Visitors: 7772

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    12495×  
Prices - CAD eShop:

Back   All CAD Tips

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   

Increase your productivity with our set of add-on functions for AutoCAD Civil 3D
CADstudio Civil Tools More info

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