确定文档是否为会话的活动文档。 支持的平台:仅窗口 属性值只读:是的 类型:布尔 确定文档是否为会话的活动文档。
言论没有额外的评论。 例子工 务 局: Sub Example_Active() ' This example creates two new drawings and determines ' which of the drawings is the active drawing. Dim NewDrawing1 As AcadDocument Dim Newdrawing2 As AcadDocument Set NewDrawing1 = ThisDrawing.Application.Documents.Add("") Set Newdrawing2 = ThisDrawing.Application.Documents.Add("") Dim activeStatus As String Dim drawing As AcadDocument activeStatus = "" For Each drawing In ThisDrawing.Application.Documents If drawing.Active Then activeStatus = activeStatus & drawing.Name & " is active." & vbCrLf Else activeStatus = activeStatus & drawing.Name & " is not active." & vbCrLf End If Next drawing MsgBox activeStatus End Sub Visual LISP: (vl-load-com) (defun c:Example_Active() ;; This example creates two new drawings and determines ;; which open drawing is the active drawing. (setq acadObj (vlax-get-acad-object)) (setq docs (vla-get-Documents acadObj)) (setq NewDrawing1 (vla-Add docs "")) (setq NewDrawing2 (vla-Add docs "")) (setq activeStatus "") (vlax-for each-doc docs (princ (vla-get-Active each-doc)) (if (= (vla-get-Active each-doc) :vlax-true) (setq activeStatus (strcat activeStatus (vla-get-name each-doc) " is active.\n")) (setq activeStatus (strcat activeStatus (vla-get-name each-doc) " is not active.\n")) ) ) (alert activeStatus) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:27
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.