AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

Your code for changing the screen colors works well, but it doesn't change the crosshair colors. This results in crosshairs the same color as the background :-)

This is what I ended up with:
Thanks for the huge jump-start!!!
Mike Weaver

;CODING STARTS HERE
(vl-load-com)

;Toggle Paper Space
(defun c:pswhite()(screencolors nil 16777215 0)(princ))
(defun c:psblack()(screencolors nil 0 16777215)(princ))
(defun c:psgray()(screencolors nil 5592405 5592575)(princ))

;Toggle Model Space
(defun c:mswhite()(screencolors T 16777215 0))
(defun c:msblack()(screencolors T 0 16777215))
(defun c:msgray()(screencolors T 5592405 5592575))

;;; mspace nil - use paper space
;;; mspace T - use model space

(defun screencolors(mspace bkgrnd crshrs)
(setq acaddisplay (vla-get-display (vla-get-preferences (vlax-get-Acad-Object))))
(if (null mspace)
(progn
(vla-put-GraphicsWinLayoutBackgrndColor acaddisplay bkgrnd)
(vla-put-LayoutCrosshairColor acaddisplay crshrs)
);progn
(progn
(vla-put-GraphicsWinModelBackgrndColor acaddisplay bkgrnd)
(vla-put-ModelCrosshairColor acaddisplay crshrs)
);progn
);if
(princ)
);defun
(princ)
;CODING ENDS HERE

The AutoLisp/Visual Lisp/VBA Resource Website

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website