Jump to content

VBA - Get the names of all AutoCAD files open


katto01

Recommended Posts

Lisp version close for VBA (setq acDocs (vla-get-documents (vlax-get-acad-object)))

 

(vlax-dump-object  (vla-get-documents (vlax-get-acad-object)))
; IAcadDocuments: The collection of all AutoCAD drawings open in the current session
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff747b21e30>
;   Count (RO) = 2

Link to comment
Share on other sites

Yeah understand but I dont work in VBA often, convert (setq acDocs (vla-get-documents (vlax-get-acad-object))) to VBA google etc

 

Something like AcadApplication.Documents

Link to comment
Share on other sites

  • 1 month later...

Sub DocOpened()
a = AcadApplication.Documents.Count
b = AcadApplication.Documents.Item(1).Name
c = AcadApplication.Documents.Item(2).Name
d = AcadApplication.Documents.Item(3).Name


End Sub
 

Edited by PeterPan9720
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...