CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

游标大小属性 (ActiveX)

2023-1-3 19:42| 发布者: admin| 查看: 401| 评论: 0|来自: AutoCAD

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

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

支持的平台:仅窗口

签名

工 务 局:

object.CursorSize
对象

类型:首选项显示

此属性适用的对象。

属性值

只读:

类型:整数

一个介于 1 到 100 之间的正整数,表示要调整十字准线大小的总屏幕面积的百分比。

言论

此属性的默认值为 5%。

允许的范围是整个屏幕的 1% 到 100%。在 100% 时,十字准线的末端是不可见的。如果尺寸减小到 99% 或更低,则十字准线的大小有限,并且十字准线的末端在移动到绘图区域的边缘时可见。

注意:此属性的值存储在 CURSORSIZE 系统变量中。

例子

工 务 局:

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

Visual 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-5-12 06:47

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部