SCMTimeValue 属性 (ActiveX) 
通过设置显示快捷菜单的长按持续时间来控制时间敏感的右键单击行为。 支持的平台:仅限 Windows 属性值只读:不 类型:长 介于 100 和 10,000 之间的数字(以毫秒为单位)。初始值为 250。 言论当该属性设置为 时,此属性会影响右键单击行为。SCMTimeModeTrue 注意:此属性的值存储在 SHORTCUTMENUDURATION 系统变量中。 
例子VBA: 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
可视化 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)))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 20:14
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.