Toggle AutoCAD Background
This bit of lisp code will toggle the background color from white to black to white in whatever space you are in. (no effect on the block editor though...)
(vl-load-com)
(defun c:TBC (/ pref col tm)
(setq tm (getvar "tilemode"))
(setq pref (vla-get-display
(vla-get-Preferences
(vlax-get-acad-object)
)
)
)
(if (zerop tm)
(setq cur (vla-get-graphicswinlayoutbackgrndcolor pref))
(setq cur (vla-get-graphicswinmodelbackgrndcolor pref))
)
(setq col (vlax-variant-value
(vlax-variant-change-type
cur
vlax-vblong
)
)
)
(if (not (or (eq col 0) (eq col 16777215)))
(setq col 0)
)
(cond ((zerop tm)
(vla-put-graphicswinlayoutbackgrndcolor
pref
(vlax-make-variant (abs (- col 16777215)) vlax-vblong)
)
(vla-put-layoutcrosshaircolor
pref
(vlax-make-variant col vlax-vblong)
)
)
(t
(vla-put-graphicswinmodelbackgrndcolor
pref
(vlax-make-variant (abs (- col 16777215)) vlax-vblong)
)
(vla-put-modelcrosshaircolor
pref
(vlax-make-variant col vlax-vblong)
)
)
)
(vlax-release-object pref)
(princ)
)
All content is copyright © CAD PANACEA 2005-2011 unless otherwise noted.
All content of CAD PANACEA is solely my own personal thoughts and opinions and do not those of any other entity or person.
All comments posted to this blog are the sole responsibility of the person making the comment.
Google, as a third party vendor, uses cookies to serve ads on this site. Google's use of their cookies enables it to serve ads to users based on their visit to your sites and other sites on the Internet. You may opt out of the use of these cookies by visiting the Google ad and content network privacy policy.

Recent comments
3 weeks 5 days ago
6 weeks 4 days ago
6 weeks 4 days ago
6 weeks 4 days ago
6 weeks 4 days ago
11 weeks 3 days ago
11 weeks 5 days ago
17 weeks 3 days ago
17 weeks 4 days ago
19 weeks 2 days ago