Jump to content

VBA - Get the names of all AutoCAD files open


Recommended Posts

Posted

Hello,

 

Is there a way to get the names of all AutoCAD files open using VBA?

 

Thank you

Posted

Hmmm.  Is this for a network wide application across multiple users?

Posted

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

Posted

thanks. sorry i need VBA. need to incorporate this into a larger VBA code

 

Posted

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

  • 1 month later...
Posted (edited)

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

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...