How to Get all opened documents(drawings)

How to Get all opened documents(drawings)

Anonymous
Not applicable
1,217 Views
1 Reply
Message 1 of 2

How to Get all opened documents(drawings)

Anonymous
Not applicable

I am using AutoCAD 2012 and the .NET API. Can someone help me how can i loop through the document objects of all the open documents? i am trying to do something like the code below..

 

public void GetDocNames()
        {
            DocumentCollection docs = Application.DocumentManager;

            for (int i = 0; i < docs.Count; i++)
            {
                AcadDocument doc = docs[i];
                Debug.Print(doc.Name);
            }
        }

 

0 Likes
Accepted solutions (1)
1,218 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution
For Each element As Autodesk.AutoCAD.ApplicationServices.Document In Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager
            
.. your code.
        Next

 

with this you have all open document