CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

GetAcadState 方法 (ActiveX)

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

GetAcadState 方法 (ActiveX)

获取一个 AcadState 对象,以监视进程外应用程序的 AutoCAD 状态。

支持的平台:仅限 Windows

签名

VBA:

RetVal = object.GetAcadState()
对象

类型: 应用

此方法应用到的对象。

返回值 (RetVal)

类型: AcadState

包含用于监视 AutoCAD 状态的特性的对象。IsQuiescent

言论

建议您在获取 AutoCAD 应用程序对象后立即调用此方法。这是识别处于静止状态的 AutoCAD 的最佳机会。

例子

VBA:

Sub Example_GetAcadState()
    ' This example gets the acadState object and checks to see if
    ' AutoCAD is in a quiescent state.
    Dim State As AcadState
    Set State = GetAcadState

    If State.IsQuiescent Then
        MsgBox "AutoCAD is quiescent."
    Else
        MsgBox "AutoCAD is not quiescent."
    End If
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_GetAcadState()
    ;; This example gets the acadState object and checks to see if
    ;; AutoCAD is in a quiescent state.
    (setq acadObj (vlax-get-acad-object))
  
    (setq State (vla-GetAcadState acadObj))
    (if (= (vla-get-IsQuiescent State) :vlax-true)
        (alert "AutoCAD is quiescent.")
        (alert "AutoCAD is not quiescent.")
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-3-14 07:31

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部