[CommandMethod("t11", CommandFlags.Session)] public static void Test11() { var doc = Application.DocumentManager.Open(@"D:\Downloads\fm.dwg"); var db = doc.Database; var ed = doc.Editor;
var hostapp = HostApplicationServices.Current;
using (doc.LockDocument()) { using (Transaction tr = db.TransactionManager.StartTransaction()) { var tstable = db.TextStyleTableId.GetObject(OpenMode.ForRead) as TextStyleTable; foreach (ObjectId id in tstable) { var tstr = id.GetObject(OpenMode.ForRead) as TextStyleTableRecord; ed.WriteMessage ( "\n{0}:{1},{2}", tstr.Name, FindFontFile(db, tstr.FileName), FindFontFile(db, tstr.BigFontFileName) ); } } } ed.WriteMessage("\n"); }
public static string FindFontFile(Database db, string name) { var hostapp = HostApplicationServices.Current;