CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

SCMDefaultMode 属性 (ActiveX)

2024-5-18 19:09| 发布者: admin| 查看: 96| 评论: 0|原作者: admin|来自: AutoCAD

SCMDefaultMode 属性 (ActiveX)

在“默认”模式下确定绘图区域中的右键单击功能,这意味着未选择任何对象,也未执行任何命令。

支持的平台:仅限 Windows

签名

VBA:

object.SCMDefaultMode
对象

类型:PreferencesUser

此属性应用于的对象。

属性值

只读:

类型:枚举AcDrawingAreaSCMDefault

  • acRepeatLastCommand:禁用默认快捷菜单。因此,当未选择任何对象且未执行任何命令时,在绘图区域中单击鼠标右键将发出 Enter,这将重复上次发出的命令。
  • acSCM:启用默认快捷菜单。

言论

此属性的初始值为 。acSCM

仅当该属性设置为 时,才能设置此属性。ShortcutMenuDisplayTrue

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

例子

VBA:

Sub Example_SCMDefaultMode()
    ' This example reads and modifies the SCMDefaultMode
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.
    
    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer
    
    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.Preferences.User
    
    ' Read and display the original value
    originalValue = ACADPref.SCMDefaultMode
    MsgBox "The SCMDefaultMode preference is set to: " & originalValue

    ' Modify the SCMDefaultMode preference by toggling the value
    ACADPref.SCMDefaultMode = acRepeatLastCommand

    MsgBox "The SCMDefaultMode preference has been set to: " & ACADPref.SCMDefaultMode

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

可视化 LISP:

(vl-load-com)
(defun c:Example_SCMDefaultMode()
    ;; This example reads and modifies the SCMDefaultMode
    ;; preference value.
    ;; When finished, this example resets the preference value back 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-SCMDefaultMode (vla-get-User preferences)))
    (alert (strcat "The SCMDefaultMode preference is set to: " (itoa originalValue)))

    ;; Modify the SCMDefaultMode preference by toggling the value
    (vla-put-SCMDefaultMode (vla-get-User preferences) acRepeatLastCommand)
    (alert (strcat "The SCMDefaultMode preference has been set to: " (itoa (vla-get-SCMDefaultMode (vla-get-User preferences)))))

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

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 11:43

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部