Accessing AutoCAD Path and Directory Names (AutoCAD .net API)

A code snippet to show you how to get at some common path / directories. I tend to use the methods of combining, because occassionally, AutoCAD’s current drawing path is not it’s current drawing path (when for example you use the Database.Filename property of the .net API) - but instead, what is returned is a path deep in the bowels of Window’s temp directory comes up. And that’s obviously the wrong value. So a hack I tend to use is to combine the drawing name (excluding the path) and the directory of where the drawing currently resides, and to combine the two using a System.IO.Paths.Combine(...) method (you’ll have to pass in the appropriate parameters of course) to come to the desired answer.

Hope this code snippet will help you:

Common Paths when Developing:

I always tend to forget with the ObjectARX dlls are contained:

C:\Autodesk\Autodesk_ObjectARX_2019_Win_64_and_32_Bit\inc\
Written on August 15, 2018