CursorSize 属性 (ActiveX)
将十字准线大小指定为屏幕大小的百分比。 支持的平台:仅限 Windows 属性值只读:不 类型:整数 从 1 到 100 的正整数,表示十字准线大小占总屏幕面积的百分比。 言论此属性的默认值为 5%。 允许的范围是总屏幕的 1% 到 100%。在 100% 时,十字准线的末端不可见。如果尺寸减小到 99% 或更低,则十字准线的尺寸有限,并且当移动到绘图区域的边缘时,十字准线的末端是可见的。
注意:此属性的值存储在 CURSORSIZE 系统变量中。
例子VBA: Sub Example_CursorSize()
' This example returns the current setting of
' CursorSize. It then changes the value, and finally
' it resets the value back to the original setting.
Dim preferences As AcadPreferences
Dim currCursorSize As Integer
Dim newCursorSize As Integer
Set preferences = ThisDrawing.Application.preferences
' Retrieve the current CursorSize value
currCursorSize = preferences.DISPLAY.CursorSize
MsgBox "The current value for CursorSize is " & currCursorSize, vbInformation, "CursorSize Example"
' Change the value for CursorSize
newCursorSize = 10
preferences.DISPLAY.CursorSize = newCursorSize
MsgBox "The new value for CursorSize is " & newCursorSize, vbInformation, "CursorSize Example"
' Reset CursorSize to its original value
preferences.DISPLAY.CursorSize = currCursorSize
MsgBox "The CursorSize value is reset to " & currCursorSize, vbInformation, "CursorSize Example"
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_CursorSize()
;; This example returns the current setting of
;; CursorSize. It then changes the value, and finally
;; it resets the value back to the original setting.
(setq acadObj (vlax-get-acad-object))
(setq preferences (vla-get-Preferences acadObj))
;; Retrieve the current CursorSize value
(setq currCursorSize (vla-get-CursorSize (vla-get-Display preferences)))
(alert (strcat "The current value for CursorSize is " (itoa currCursorSize)))
;; Change the value for CursorSize
(setq newCursorSize 10)
(vla-put-CursorSize (vla-get-Display preferences) newCursorSize)
(alert (strcat "The new value for CursorSize is " (itoa newCursorSize)))
;; Reset CursorSize to its original value
(vla-put-CursorSize (vla-get-Display preferences) currCursorSize)
(alert (strcat "The CursorSize value is reset to " (itoa currCursorSize)))
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-31 06:41
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.