Specifies the background color for the paper space layouts.
Supported platforms: Windows only
VBA:
object.GraphicsWinLayoutBackgrndColor
Type: PreferencesDisplay
The object this property applies to.
Read-only: No
Type: OLE_COLOR (constant)
The initial value for this property is a color halfway between the Windows standard background color and the Windows standard active button color.
The paper space windows are identified by the Layout tabs in AutoCAD. The model space window is identified by the Model tab. You can change the background color of the model space window by using the GraphicsWinModelBackgrndColor property.
VBA:
Sub Example_GraphicsWinLayoutBackgrndColor() ' This example returns the current setting of ' GraphicsWinLayoutBackgrndColor. It then changes the value, and finally ' it resets the value back to the original setting. Dim preferences As AcadPreferences Dim currGraphicsWinLayoutBackgrndColor As OLE_COLOR Set preferences = ThisDrawing.Application.preferences ' Retrieve the current GraphicsWinLayoutBackgrndColor value currGraphicsWinLayoutBackgrndColor = preferences.DISPLAY.GraphicsWinLayoutBackgrndColor MsgBox "The current value for GraphicsWinLayoutBackgrndColor is " _ & preferences.DISPLAY.GraphicsWinLayoutBackgrndColor, vbInformation, "GraphicsWinLayoutBackgrndColor Example" ' Change the value for GraphicsWinLayoutBackgrndColor preferences.DISPLAY.GraphicsWinLayoutBackgrndColor = 16 MsgBox "The new value for GraphicsWinLayoutBackgrndColor is " _ & preferences.DISPLAY.GraphicsWinLayoutBackgrndColor, vbInformation, "GraphicsWinLayoutBackgrndColor Example" ' Reset GraphicsWinLayoutBackgrndColor to its original value preferences.DISPLAY.GraphicsWinLayoutBackgrndColor = currGraphicsWinLayoutBackgrndColor MsgBox "The GraphicsWinLayoutBackgrndColor value is reset to " _ & preferences.DISPLAY.GraphicsWinLayoutBackgrndColor, vbInformation, "GraphicsWinLayoutBackgrndColor Example" End Sub
Visual LISP:
(vl-load-com) (defun c:Example_GraphicsWinLayoutBackgrndColor() ;; This example returns the current setting of ;; GraphicsWinLayoutBackgrndColor. It then changes the value, and finally ;; it resets the value back to the original setting. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq preferences (vla-get-Preferences acadObj)) ;; Set PaperSpace/Layout current (vla-put-ActiveSpace doc acPaperSpace) ;; Retrieve the current GraphicsWinLayoutBackgrndColor value (setq currGraphicsWinLayoutBackgrndColor (vlax-variant-change-type (vla-get-GraphicsWinLayoutBackgrndColor (vla-get-Display preferences)) vlax-vbLong)) (alert (strcat "The current value for GraphicsWinLayoutBackgrndColor is " (itoa (vlax-variant-value currGraphicsWinLayoutBackgrndColor)))) ;; Change the value for GraphicsWinLayoutBackgrndColor (vla-put-GraphicsWinLayoutBackgrndColor ACADPref (vlax-make-variant 127 19)) (setq newValue (vlax-variant-change-type (vla-get-GraphicsWinLayoutBackgrndColor ACADPref) vlax-vbLong)) (alert (strcat "The new value for GraphicsWinLayoutBackgrndColor is " (itoa (vlax-variant-value newValue)))) ;; Reset GraphicsWinLayoutBackgrndColor to its original value (vla-put-GraphicsWinLayoutBackgrndColor ACADPref currGraphicsWinLayoutBackgrndColor) (alert (strcat "The GraphicsWinLayoutBackgrndColor value is reset to " (itoa (vlax-variant-value currGraphicsWinLayoutBackgrndColor)))) )