rkmswain-that works beautifully to change the background. now if I can just insert it into the lisp that I have or find what works for white. Here is what I have currently: (Forgive me I don't know how to get it into a code box.) Btw, this changes the show plot styles variable to show or not show, turns on and off the lineweight display, and hopefully will change the background.
Code:
(defun C:PST ( ; No arguments.
/
acadDocument ; Holds reference to the active AutoCAD drawing object.
acadLayout ; Holds reference to the active Layout object.
acadObject ; Holds reference to the AutoCAD object.
showPStyles ; Holds current status of PlotStyle display on the active Layout.
) ;_ End arguments & local variables.
(cond ; Cond A
((= (getvar "TILEMODE") 1) ; Model tab is active, abort command.
(alert
(strcat
"C:PST is meant for use on a Layout tab, not on the Model tab."
"\nPlease change to a Layout tab and try again."
) ;_ End strcat.
) ;_ End alert.
) ;_ End condition A1.
(T ; Condition A2.
(vl-load-com) ; Load "vl" functions, if not already loaded.
(setq
acadObject (vlax-get-acad-object)
acadDocument (vlax-get-property acadObject 'ActiveDocument)
acadLayout (vlax-get-property acadDocument 'ActiveLayout)
showPStyles (vlax-get-property acadLayout 'ShowPlotStyles)
) ;_ End setq.
(if (= showPStyles :vlax-true)
(progn
(vlax-put-property acadLayout 'ShowPlotStyles :vlax-false)
(setvar "lwdisplay" 0)
(setq AcadPreference (vlax-get-property (vlax-get-acad-object) 'preferences))
(setq AcadPreferenceDisplay (vlax-get-property AcadPreference 'display))
(vlax-put-property AcadPreferenceDisplay 'GraphicsWinlayoutBackgrndColor 0);; <- put your color here..
(vlax-release-object AcadPreference)
(vlax-release-object AcadPreferenceDisplay)
(prompt "\nThe display of plot styles has been turned off. ")
) ;_ End progn.
(progn
(vlax-put-property acadLayout 'ShowPlotStyles :vlax-true)
(setvar "lwdisplay" 1)
(setq AcadPreference (vlax-get-property (vlax-get-acad-object) 'preferences))
(setq AcadPreferenceDisplay (vlax-get-property AcadPreference 'display))
(vlax-put-property AcadPreferenceDisplay 'GraphicsWinlayoutBackgrndColor 16777215);; <- put your color here..
(vlax-release-object AcadPreference)
(vlax-release-object AcadPreferenceDisplay)
(prompt "\nThe display of plot styles has been turned on. ")
);_ End progn.
) ;_ End if.
(vlax-release-object acadLayout)
(vlax-release-object acadDocument)
(vlax-release-object acadObject)
(command "_.REGENALL") ; Regenerate the screen graphics.
) ;_ End condition A2.
) ;_ End cond A.
(prin1)
) ;_ End C:PST.