別のアプリケーションから AutoCAD の状態を監視するために AcadState オブジェクトを取得します。
サポートされているプラットフォーム: Windows のみ
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
Visual 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.")
)
)