WindowTitle 属性 (ActiveX)
获取文档窗口的标题。 支持的平台:仅限 Windows 属性值只读:是的 类型:字符串 文档的窗口标题。 言论没有其他评论。 例子VBA: Sub Example_WindowTitle() ' This example cycles through the documents collection ' and uses the WindowTitle property to create a list of 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 all open drawings and get the window title of each drawing For Each DOC In Documents msg = msg & DOC.WindowTitle Next ' Display a list of open drawings MsgBox "The open drawing titles are: " & msg End Sub 可视化 LISP: (vl-load-com) (defun c:Example_WindowTitle() ;; This example cycles through the documents collection ;; and uses the WindowTitle property to create a list of all open documents. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; If there are no open documents, then exit (if (> (vla-get-Count (vla-get-Documents acadObj)) 0) (progn (setq msg "") ;; Cycle through all open drawings and get the window title of each drawing (vlax-for DOC (vla-get-Documents acadObj) (setq msg (strcat msg "\n" (vla-get-WindowTitle DOC))) ) ;; Display a list of open drawings (alert (strcat "The open drawing titles are: " msg)) ) (alert "There are no open documents!") ) ) |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-3-5 15:53
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.