CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

SCMTimeMode 属性 (ActiveX)

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

摘要: 控制时间敏感的右键单击行为。

控制时间敏感的右键单击行为。

支持的平台:仅窗口

签名

工 务 局:

object.SCMTimeMode
对象

类型:首选项用户

此属性适用的对象。

属性值

只读:

类型:布尔

  • True:启用时效性右键单击。
  • False:禁用时效性右键单击。

言论

此属性用于设置时间敏感的右键单击行为。快速单击与按 Enter 相同。单击时间越长,将显示快捷菜单。仅当属性设置为时,才能设置此属性。ShortcutMenuDisplayTrue

您可以使用属性设置右键单击的持续时间。SCMTimeValue

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

例子

工 务 局:

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

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

Visual LISP:

(vl-load-com)
(defun c:Example_SCMTimeMode()
    ;; This example reads and modifies the SCMTimeMode property.
    ;; Then the property is reset to its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-SCMTimeMode (vla-get-User preferences)))
    (alert (strcat "The SCMTimeMode property is currently: " (if (= originalValue :vlax-true) "True" "False")))
  
    ;; Modify the SCMTimeMode preference by toggling the value
    (setq newValue (if (= originalValue :vlax-true) :vlax-false :vlax-true))
    (vla-put-SCMTimeMode (vla-get-User preferences) newValue)
    (alert (strcat "The SCMTimeMode property has been set to: " (if (= newValue :vlax-true) "True" "False")))

    ;; Reset the preference back to its original value
    (vla-put-SCMTimeMode (vla-get-User preferences) originalValue)
    (alert (strcat "The SCMTimeMode property was reset back to: " (if (= originalValue :vlax-true) "True" "False")))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 02:22

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部