Sorry for the old thread bump, but looking for a LISP to undo this. Basically i'd like to be able to toggle my paper space from what it'll look like when it prints (white background and plotstyles on) to my layer colors and blackbackground (how i work) I have everything working except when i switch back to the blackbackground, it won't switch the plotstyles back. I'm a novice with LSP. I tried just changing false/true, but it didn't work. The above text in this thread is in the first wb command and works. It's the second part in the db command where i'm trying to get it to shut them off.
(defun c:wb () ;;white background
(setq whitebackground T)
(setq acadobject (vlax-get-acad-object))
(setq acadpref (vlax-get-property acadobject 'preferences))
_(setq acaddisp (vlax-get-property acadpref 'display))
_ _ _(vlax-put-property acaddisp 'GraphicsWinLayoutBackgrndColor 16777215)
_ _ _(vlax-put-property acaddisp 'ModelCrosshairColor 0)
(setq acdoc (vla-get-activedocument (vlax-get-acad-object))
aclays (vla-get-layouts acdoc))
(vlax-for lay aclays
(if (eq :vlax-false (vla-get-modeltype lay))
(vlax-put-property lay 'ShowPlotStyles :vlax-true)))
(command "_.REGENALL")
(prompt "\n'Display plot styles' option applid to all layouts.")
(princ)
)
(defun c:db () ;; black background
(setq whitebackground nil)
_(setq acadobject (vlax-get-acad-object))
_(setq acadpref (vlax-get-property acadobject 'preferences))
_(setq acaddisp (vlax-get-property acadpref 'display))
_ (vlax-put-property acaddisp 'GraphicsWinLayoutBackgrndColor 0)
_ (vlax-put-property acaddisp 'ModelCrosshairColor 16777215)
_)
(setq acdoc (vla-get-activedocument (vlax-get-acad-object))
aclays (vla-get-layouts acdoc))
(vlax-for lay aclays
(if (eq :vlax-true (vla-get-modeltype lay))
(vlax-put-property lay 'ShowPlotStyles :vlax-false)))
(command "_.REGENALL")
(prompt "\n'Display plot styles' option applid to all layouts.")
(princ)
(if whitebackground (db) (wb))