I have recently found a need to use a background color changing routine again.
A simple cut/copy/paste does not require changing the background from
black to white. However, a jpgout requires the change.
I thought I would share my favorite routine:
Code:
(defun C:BCOLOR ()
(cond
((= (getvar "TileMode") 0) ;Check Space, Exit if not in ModelSpace
(prompt
"\n***Command only works in ModelSpace, TileMode = 1***"
)
)
((= (getenv "Background") "16777215")
;ModelSpace Background colour = White
(setenv "Background" "0") ;Set ModelSpace Background colour = Black
(setenv "XhairPickboxEtc" "16777215")
;Set ModelSpace Crosshair colour = White
(setvar "TileMode" 0) ;Force Display to update
(setvar "TileMode" 1)
(prompt "\n***ModelSpace Background colour set to Black***")
)
((= (getenv "Background") "0") ;ModelSpace Background colour = Black
(setenv "Background" "16777215") ;Set ModelSpace Background colour = White
(setenv "XhairPickboxEtc" "0") ;Set ModelSpace Crosshair colour = Black
(setvar "TileMode" 0) ;Force Display to update
(setvar "TileMode" 1)
(prompt "\n***ModelSpace Background colour set to White***")
)
(T ;Exit if ModelSpace Background colour /= Black or White
(prompt "\n***ModelSpace Background colour not altered***")
)
)
(princ)
)