CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

SCMTimeValue Property (ActiveX)

2023-1-3 06:52| 发布者: admin| 查看: 216| 评论: 0|来自: AutoCAD

摘要: 通过设置显示快捷菜单的长按持续时间来控制时间敏感的右键单击行为。

通过设置显示快捷菜单的长按持续时间来控制时间敏感的右键单击行为。

支持的平台:仅窗口

签名

工 务 局:

object.SCMTimeValue
对象

类型:首选项用户

此属性适用的对象。

属性值

只读:

类型:

以毫秒为单位的数字,介于 100 和 10,000 之间。初始值为 250。

言论

此属性会影响属性设置为 时的右键单击行为。SCMTimeModeTrue

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

例子

工 务 局:

Sub Example_SCMTimeValue()
    ' This example reads and modifies the SCMTimeValue property.
    ' Then the property is reset to its original value.
    
    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer
    
    ' Get the UserPreferences object and set the SCMTimeMode property to True
    Set ACADPref = ThisDrawing.Application.Preferences.User
    ACADPref.SCMTimeMode = True
    
    originalValue = ACADPref.SCMTimeValue
    MsgBox "The SCMTimeValue property is currently: " & originalValue
    
    newValue = 1000
    ACADPref.SCMTimeValue = newValue
    
    MsgBox "The SCMTimeValue property has been set to: " & ACADPref.SCMTimeValue

    ' Reset the preference back to its original value
    ACADPref.SCMTimeValue = originalValue
    MsgBox "The SCMTimeValue property was reset back to: " & originalValue
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_SCMTimeValue()
    ;; This example reads and modifies the SCMTimeValue property.
    ;; Then the property is reset to its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Get the UserPreferences object and set the SCMTimeMode property to True
    (vla-put-SCMTimeMode (vla-get-User preferences) :vlax-true)

    (setq originalValue (vla-get-SCMTimeValue (vla-get-User preferences)))
    (alert (strcat "The SCMTimeValue property is currently: " (itoa originalValue)))
    
    (setq newValue 1000)
    (vla-put-SCMTimeValue (vla-get-User preferences) newValue)
    
    (alert (strcat "The SCMTimeValue property has been set to: " (itoa (vla-get-SCMTimeValue (vla-get-User preferences)))))

    ;; Reset the preference back to its original value
    (vla-put-SCMTimeValue (vla-get-User preferences) originalValue)
    (alert (strcat "The SCMTimeValue property was reset back to: " (itoa originalValue)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 04:05

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部