CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

文档属性 (ActiveX)

2023-1-3 18:03| 发布者: admin| 查看: 483| 评论: 0|来自: AutoCAD

摘要: 获取文档集合。

获取文档集合。

支持的平台:仅窗口

签名

工 务 局:

object.Documents
对象

类型:应用

此属性适用的对象。

属性值

只读:是的

类型:文档

当前 AutoCAD 会话的集合。Documents

言论

集合允许您访问当前 AutoCAD 会话中的所有文档或图形。Documents

例子

工 务 局:

Sub Example_Documents()
    ' This example obtains a reference to the Documents collection
    ' and displays information about the loaded documents.

    Dim Document As AcadDocument
    Dim msg As String
    msg = vbCrLf
    
    ' Cycle through the Documents collection and retrieve the names
    ' of the loaded documents
    For Each Document In Documents
        msg = msg & Document.Name & vbCrLf
    Next
    
    ' Display loaded document information
    If Documents.Count > 0 Then
        MsgBox "The loaded documents are: " & msg
    Else
        MsgBox "There are no loaded documents!"
    End If
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Documents()
    ;; This example obtains a reference to the Documents collection
    ;; and displays information about the loaded documents.
    (setq acadObj (vlax-get-acad-object))
 
    ;; Cycle through the Documents collection and retrieve the names
    ;; of the loaded documents
    (setq msg "")
    (vlax-for Document (vla-get-Documents acadObj)
        (setq msg (strcat msg "\n" (vla-get-Name Document)))
    )
    
    ;; Display loaded document information
    (if (> (vla-get-Count (vla-get-Documents acadObj)))
        (alert (strcat "The loaded documents are: " msg))
        (alert "There are no loaded documents!")
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 06:06

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部