モデル空間ウィンドウの背景色を指定します。
サポートされているプラットフォーム: Windows のみ
読み込み専用: いいえ
タイプ: OLE_COLOR (定数)
このプロパティの既定の色は vbBlack です。
VBA:
Sub Example_GraphicsWinModelBackgrndColor() ' This example returns the current setting of ' GraphicsWinModelBackgrndColor. It then changes the value, and finally ' it resets the value back to the original setting. Dim preferences As AcadPreferences Dim currGraphicsWinModelBackgrndColor As OLE_COLOR Set preferences = ThisDrawing.Application.preferences ' Retrieve the current GraphicsWinModelBackgrndColor value currGraphicsWinModelBackgrndColor = preferences.DISPLAY.GraphicsWinModelBackgrndColor MsgBox "The current value for GraphicsWinModelBackgrndColor is " _ & preferences.DISPLAY.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example" ' Change the value for GraphicsWinModelBackgrndColor preferences.DISPLAY.GraphicsWinModelBackgrndColor = 16 MsgBox "The new value for GraphicsWinModelBackgrndColor is " _ & preferences.DISPLAY.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example" ' Reset GraphicsWinModelBackgrndColor to its original value preferences.DISPLAY.GraphicsWinModelBackgrndColor = currGraphicsWinModelBackgrndColor MsgBox "The GraphicsWinModelBackgrndColor value is reset to " _ & preferences.DISPLAY.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example" End Sub
Visual LISP:
(vl-load-com) (defun c:Example_GraphicsWinModelBackgrndColor() ;; This example returns the current setting of ;; GraphicsWinModelBackgrndColor. 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)) ;; Retrieve the current GraphicsWinModelBackgrndColor value (setq currGraphicsWinModelBackgrndColor (vlax-variant-change-type (vla-get-GraphicsWinModelBackgrndColor (vla-get-Display preferences)) vlax-vbLong)) (alert (strcat "The current value for GraphicsWinModelBackgrndColor is " (itoa (vlax-variant-value currGraphicsWinModelBackgrndColor)))) ;; Change the value for GraphicsWinModelBackgrndColor (vla-put-GraphicsWinModelBackgrndColor ACADPref (vlax-make-variant 127 19)) (setq newValue (vlax-variant-change-type (vla-get-GraphicsWinModelBackgrndColor ACADPref) vlax-vbLong)) (alert (strcat "The new value for GraphicsWinModelBackgrndColor is " (itoa (vlax-variant-value newValue)))) ;; Reset GraphicsWinModelBackgrndColor to its original value (vla-put-GraphicsWinModelBackgrndColor ACADPref currGraphicsWinModelBackgrndColor) (alert (strcat "The GraphicsWinModelBackgrndColor value is reset to " (itoa (vlax-variant-value currGraphicsWinModelBackgrndColor)))) )