Specifies the active document (drawing file).
Supported platforms: Windows only
No additional remarks.
VBA:
Sub Example_ActiveDocument() Dim activeDoc As AcadDocument ' Returns current document in AutoCAD Set activeDoc = ThisDrawing.Application.ActiveDocument MsgBox "The active document is: " & activeDoc.name, vbInformation, "ActiveDocument Example" End Sub
Visual LISP:
(vl-load-com) (defun c:Example_ActiveDocument() ;; Returns current document in AutoCAD (setq acadObj (vlax-get-acad-object)) (setq activeDoc (vla-get-ActiveDocument acadObj)) (alert (strcat "The active document is: " (vla-get-Name activeDoc))) )