CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

窗口标题属性 (ActiveX)

2023-1-3 01:05| 发布者: admin| 查看: 175| 评论: 0|来自: AutoCAD

摘要: 获取文档窗口的标题。

获取文档窗口的标题。

支持的平台:仅窗口

签名

工 务 局:

object.WindowTitle
对象

类型:文档

此属性适用的对象。

属性值

只读:是的

类型:字符串

文档的窗口标题。

言论

没有额外的评论。

例子

工 务 局:

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

Visual 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!")
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 13:10

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部