This worked pretty good... it only takes 2 letters to go back and forth between the colors, but I would still like to make it work as a toggle.
Code:
***********************************************
;;Background color changer
;;Gary Maze, SMC Corporation of America
;;11/27/02
;;
;;acadobject is the ActiveX component of the AutoCad instance
;;acadpref is the preferences property of acadobject
;;acaddisp is the display property of acadpref
;;the background color is the windows color number calculated
;;by the following formula;
;;(65536*blue)+(256*green)+red, where blue, green and red can
;;be 0 (off) to 255 (all the way on)
;;WB makes a whitebackground with a black crosshair
(defun c:wb () ;;white background
(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 16777215)
_ _ _(vlax-put-property acaddisp 'ModelCrosshairColor 0)
)
;;BB makes a black background with a white crosshair
(defun c:bb () ;; black background
;(defun c:blackback (/ acadobject acadpref acaddisp)
_(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 0)
_ (vlax-put-property acaddisp 'ModelCrosshairColor 16777215)
_)
;The user just wanted to change his background color to white, but I
; thought it might be nice to add a restore function as well.
********************************************
Flores
Bookmarks