ActiveDocument 示例

使用 VBA 以外的其它编程语言

Sub Example_ActiveDocument()
    Dim activeDoc As AcadDocument
    ' 返回 AutoCAD 的当前文档
    Set activeDoc = ThisDrawing.Application.ActiveDocument
    MsgBox "活动的文档为: " & activeDoc.name, vbInformation, "ActiveDocument 示例"
End Sub