How to get the path of the current Document? (AutoCAD .net API)

If you want the file path of a dawing simply use the following:

    string drawingPath = Application.DocumentManager. CurrentDocument.Database.Filename;

And if you just want the filePath (without the drawing extension you can do):

    Path.GetDirectoryName(drawingPath)

hope this helps.

Ben

Written on March 9, 2017