指定活动布局。 支持的平台:仅窗口 言论没有额外的评论。 例子工 务 局: Sub Example_ActiveLayout()
' This example cycles through the documents collection
' and uses the ActiveLayout object to list the active layout
' for all open documents.
Dim DOC As AcadDocument
Dim msg As String
' If there are no open documents, then exit
If Documents.Count = 0 Then
MsgBox "There are no open documents!"
Exit Sub
End If
msg = vbCrLf ' Start with a space
' Cycle through documents and determine the active layout name using the
' ActiveLayout property of the document object
For Each DOC In Documents
msg = msg & DOC.WindowTitle & ": " & DOC.ActiveLayout.Name & vbCrLf
Next
' Display results
MsgBox "The active layouts for the open drawings are: " & msg
End Sub
Visual LISP: (vl-load-com)
(defun c:Example_ActiveLayout()
;; This example cycles through the documents collection
;; and uses the ActiveLayout object to list the active layout
;; for all open documents.
(setq acadObj (vlax-get-acad-object))
(setq docs (vla-get-Documents acadObj))
(setq msg "")
;; Cycle through the Documents collection and determine the active layout name using the
;; ActiveLayout property of the document object
(vlax-for each-doc docs
(setq msg (strcat msg (vla-get-WindowTitle each-doc) ": " (vla-get-Name (vla-get-ActiveLayout each-doc)) "\n"))
)
;; Display results
(alert (strcat "The active layouts for the open drawings are: \n\n" msg))
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 08:43
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.