指定图纸空间布局的背景色。 支持的平台:仅窗口 属性值只读:不 类型:OLE_COLOR(常量)
言论此属性的初始值是介于 Windows 标准背景色和 Windows 标准活动按钮颜色之间的颜色。 图纸空间窗口由 AutoCAD 中的“布局”选项卡标识。模型空间窗口由“模型”选项卡标识。您可以使用属性更改模型空间窗口的背景颜色。GraphicsWinModelBackgrndColor 例子工 务 局: 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)))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:19
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.