Nice one Lee, I like the way you switch the colors.
The only thing is, if the initial color is 40 when you load the lisp, nothing happens.
I had the same problem trying to store the initial value with setenv. But if 40 is hard coded, white could be also hard coded.
(setq acadobject (vlax-get-acad-object))
(setq acadpref (vlax-get-property acadobject 'preferences))
(setq acaddisp (vlax-get-property acadpref 'display))
(vlax-put-property acaddisp 'GraphicsWinmodelBackgrndColor 65986) ;;Model space background
(vlax-put-property acaddisp 'GraphicsWinLayoutBackgrndColor 63434) ;;command area
(vlax-put-property acaddisp 'ModelCrosshairColor 865785);; crosshairs
(vlax-put-property acaddisp 'TextWinBackgrndColor 3687) ;;command area
(princ "Done doing")
There isn't a need to hardcode the original value; just check and change.Code - Auto/Visual Lisp: [Select]
;; toggle the current cursor color from 40 to white (and vise versa)
Where i can find the number for the colors
for example 49151 --> 40 and 16777215->white ???? Is any list of colors and numbers ??
The colours are expressed as OLE colours, for which you can calculate the appropriate values using the OLE conversion functions as part of my Colour Conversion functions (http://lee-mac.com/colourconversion.html).
There isn't a need to hardcode the original value; just check and change.Code - Auto/Visual Lisp: [Select]
;; toggle the current cursor color from 40 to white (and vise versa)
But here white is arbitrarily hardcoded as a default.
There isn't a need to hardcode the original value; just check and change.Code - Auto/Visual Lisp: [Select]
;; toggle the current cursor color from 40 to white (and vise versa)
But here white is arbitrarily hardcoded as a default.
No it is not (you must not have tried it). I'm just using either a LOGIOR (7) or XOR (6) to set or clear a bit(s).