ShortCutMenuDisplay 属性 (ActiveX) 
控制在绘图区域中单击鼠标右键是否显示快捷菜单或发出 Enter 键。 支持的平台:仅限 Windows 属性值只读:不 类型:布尔 
 言论此属性的初始值为 。True 当此属性设置为 时,可以使用对象中的属性自定义在绘图区域中单击鼠标右键的功能。TruePreferencesUser 注意:此属性的值存储在 SHORTCUTMENU 系统变量中。 
例子VBA: Sub Example_ShortCutMenuDisplay()
    ' This example reads and toggles the preference value which controls
    ' whether right-clicking in the drawing area displays a shortcut menu
    ' or issues ENTER.
    
    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Variant, newValue As Variant
    Dim newAction As String
    
    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.Preferences.User
    
    ' Read and display the original value
    originalValue = ACADPref.ShortCutMenuDisplay
    newAction = IIf(originalValue, "displays the shortcut menu", "sends an ENTER keystroke to ACAD")
    MsgBox "Right-clicking the mouse CURRENTLY " & newAction, vbInformation
    ' Modify the AutoSnapMarker preference by toggling the value
    ACADPref.ShortCutMenuDisplay = Not (originalValue)
    newValue = ACADPref.ShortCutMenuDisplay
    newAction = IIf(newValue, "display the shortcut menu", "send an ENTER keystroke to ACAD")
    MsgBox "Right-clicking the mouse over the drawing WILL NOW " & newAction, vbInformation
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_ShortCutMenuDisplay()
    ;; This example reads and toggles the preference value which controls
    ;; whether right-clicking in the drawing area displays a shortcut menu
    ;; or issues ENTER.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-ShortCutMenuDisplay (vla-get-User preferences)))
    (setq newAction (if (= originalValue :vlax-true) "displays the shortcut menu" "sends an ENTER keystroke to ACAD"))
    (alert (strcat "Right-clicking the mouse CURRENTLY " newAction))
  
    ;; Modify the AutoSnapMarker preference by toggling the value
    (vla-put-ShortCutMenuDisplay (vla-get-User preferences) (if (= originalValue :vlax-true) :vlax-false :vlax-true))
    (setq newValue (vla-get-ShortCutMenuDisplay (vla-get-User preferences)))
    (setq newAction (if (= newValue :vlax-true) "displays the shortcut menu" "sends an ENTER keystroke to ACAD"))
    (alert (strcat "Right-clicking the mouse over the drawing WILL NOW " newAction))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 15:16
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.