CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2020 开发者帮助

SCMCommandMode 属性 (ActiveX)

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

SCMCommandMode 属性 (ActiveX)

确定在命令模式下在绘图区域中单击鼠标右键的功能,这意味着命令当前正在进行中。

支持的平台:仅限 Windows

签名

VBA:

object.SCMCommandMode
对象

类型:PreferencesUser

此属性应用于的对象。

属性值

只读:

类型:枚举AcDrawingAreaSCMCommand

  • acEnter:禁用命令快捷菜单。因此,在执行命令时在绘图区域中单击鼠标右键会发出 Enter。
  • acEnableSCM:启用命令快捷菜单。
  • acEnableSCMOptions:仅当命令行提示符中当前有可用选项时,才启用命令快捷菜单。在命令行提示符下,选项用方括号括起来。如果没有可用的选项,请右键单击问题 Enter。

言论

此属性的初始值为 。acEnableSCMOptions

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

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

例子

VBA:

Sub Example_SCMCommandMode()
    ' This example reads and modifies the SCMCommandMode
    ' 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.SCMCommandMode
    MsgBox "The SCMCommandMode preference is set to: " & originalValue

    ' Modify the SCMCommandMode preference by toggling the value
    ACADPref.SCMCommandMode = acEnter

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

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

可视化 LISP:

(vl-load-com)
(defun c:Example_SCMCommandMode()
    ;; This example reads and modifies the SCMCommandMode
    ;; 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-SCMCommandMode (vla-get-User preferences)))
    (alert (strcat "The SCMCommandMode preference is set to: " (itoa originalValue)))

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

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

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-6-27 16:23

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部