Getting the list of recently opened documents

By Virupaksha Aithal
Application class “Autodesk.AutoCAD.ApplicationServices.Application” class exposed a property “RecentDocuments”, which can be used to list out recently opened documents.

[CommandMethod("GetRecentDocument")]
static public void GetRecentDocument()
{
    Document doc = Application.DocumentManager.MdiActiveDocument;
    Editor ed = doc.Editor;
 
    foreach(RecentDocument recentDoc in Application.RecentDocuments)
    {
        ed.WriteMessage(recentDoc.Path + "n");
    }
}

Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading