PDA

View Full Version : Background color switching


Robert.Hall
2007-07-05, 02:34 PM
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:


(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)
)

rkmcswain
2007-07-05, 03:54 PM
Another version can be found here...

http://rkmcswain.blogspot.com/2007/02/toggle-autocad-background.html

Robert.Hall
2007-07-05, 08:08 PM
Nice. That routine is certainly different. Does the trick!

rkmcswain
2007-07-05, 10:29 PM
Nice. That routine is certainly different. Does the trick!

I typically work with black BG, but I will switch to white when taking screen captures.
Also, it's handy to be able to toggle from black to white during a seminar or demonstration.

Much quicker than going through the GUI.

Mr Cory
2007-07-12, 04:15 AM
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:


(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)
)

Hay is there anyway to stop this lisp setting the tracking vector to black? Took me ages to figure out what had happened lol

azarko
2007-07-12, 10:15 AM
Original posted here
http://www.autocad.ru/cgi-bin/f1/board.cgi?t=8288Cp