CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2022 开发者帮助

CursorSize 属性 (ActiveX)

2024-5-18 18:45| 发布者: admin| 查看: 12| 评论: 0|原作者: admin|来自: AutoCAD

CursorSize 属性 (ActiveX)

将十字准线大小指定为屏幕大小的百分比。

支持的平台:仅限 Windows

签名

VBA:

object.CursorSize
对象

类型:首选项显示

此属性应用于的对象。

属性值

只读:

类型:整数

从 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)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-6-27 16:05

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部