This C# code should get you started. I translated this from some similar C++ code of mine, but hopefully the .NET gurus will come along and point out anything stupid I may have done.
using System;
using System.IO;
using System.Text;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
namespace MetricOrImperial
{
public class Main
{
public static int metricOrImperial(string fileName)
{
if(!File.Exists(fileName)) return -1;
Database db = new Database(false, true);
try
{
db.ReadDwgFile(fileName, System.IO.FileShare.Read, false, string.Empty);
return db.Measurement == MeasurementValue.English ? 1 : 0;
}
catch (Exception e)
{
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(e.ToString());
return -1;
}
}
}
}