Sorry, put in the wrong PaperSpace test.
Don
"DonB" wrote in message
news:271D206435A2A0F396BA571ECFCB3773@in.WebX.maYIadrTaRb...
> This is basically the same thing, but also toggles the crosshair color.
>
> Don
>
> "Lizzy" wrote in message
> news:2E5B5A0A77F34ABBCD9E97557521701A@in.WebX.maYIadrTaRb...
> > Rather than going Tools > Preferences > Display > Colours.... I would
like
> > to change the screen display from blck to white or white to black
> > backgrounds with a script on the toolbars....
> >
> > Any help you can give would be useful...
> >
> >
> >
> > Many thanks
> >
> >
> >
>
>
----------------------------------------------------------------------------
----
(defun c:ToggleScreenColor (/ dcolor newcol crosscol prefdisplay)
(vl-load-com)
(setq prefDisplay (vla-get-display (vla-get-Preferences
(vlax-Get-Acad-Object))))
(vla-get-Display AppPreferences)
(if (is-paper)
(setq dColor
(vlax-variant-value
(vlax-variant-change-type
(vla-get-GraphicsWinLayoutBackgrndColor prefDisplay)
vlax-vbLong
)
)
)
(setq dColor
(vlax-variant-value
(vlax-variant-change-type
(vla-get-GraphicsWinModelBackgrndColor prefDisplay)
vlax-vbLong
)
)
)
)
(setq newcol (vlax-make-variant (if (= dColor 0) 16777215 0) vlax-vbLong))
(setq crosscol (vlax-make-variant (if (= dColor 0) 0 16777215) vlax-vbLong))
(if (is-paper)
(progn
(vla-put-GraphicsWinLayoutBackgrndColor prefDisplay newcol)
(vla-put-LayoutCrosshairColor prefDisplay crosscol)
)
(progn
(vla-put-GraphicsWinModelBackgrndColor prefDisplay newcol)
(vla-put-ModelCrosshairColor prefDisplay crosscol)
)
)
)
;;;IS-PAPER returns T if in NON-FLOATING PaperSpace
;;;ELSE nil for floating or complete ModelSpace
;;;Example (if (is-paper) )
(defun is-paper ()
(cond
((and (= (getvar "tilemode") 0)(/= (getvar "cvport") 1))nil)
((and (= (getvar "tilemode") 0)(= (getvar "cvport") 1))t)
(t nil)
)
)