In C# I want to get the xrefs for a drawing WITHOUT opening the drawing. Right now I can open the drawing and then use the DataBase.GetHostDwgXrefGraph to get the XrefGraph and do XrefGraphNode.Database.FileName to get the drawing path. I know that I can use this method before opening the drawing but then the Database field will be null. The alternative is to use the XrefGraphNode.BlockTableRecordId property to get the BlockTableRecord for the Xref and then do BlockTableRecord.PathName to get the Xref drawing path. The problem is that the PathName is a little confusing. For example
Main Drawing Path (from current database) = "C:\Drawings\MainDrawing.dwg"
Xref Drawing Path (PathName property) = "Drawings\XrefDrawing.dwg"
Why isn't the PathName property just set to "XrefDrawing.dwg" if it's in the same folder as the main drawing? What is the way to get the absolute path of the XrefDrawing.dwg from the MainDrawing.dwg path? Is there an alternative way I could do this?
I'm familiar with the .NET path class but why is it including the 'lib1' folder in the relative path of the xref drawing if the main drawing is also in the 'lib1' folder?