Teigha 4.0.1 .Net Classic x64
Simple code for attached dwg file:
#if TEIGHA_CLASSIC
using Db = Teigha.DatabaseServices;
using Rt = Teigha.Runtime;
#endif
...
private static void Run() {
using (Rt
.Services srv
= new Rt
.Services()) { using (Db
.Database db
= new Db
.Database(false,
true)) { String fileName = @"D:\data\123.dwg";
db.ReadDwgFile(fileName, Db.FileOpenMode.OpenForReadAndWriteNoShare,
true, null, false);
Db
.AuditInfo ai
= new Db
.AuditInfo(); ai.FixErrors = true; // Errors must be fixed
db.Audit(ai);
db.SaveAs(fileName, Db.DwgVersion.AC1021);
// Output: Total errors found: 54, fixed: 54.
Console.WriteLine("Total errors found: {0}, fixed: {1}.",
ai.NumErrors, ai.NumFixes);
}
}
Console.WriteLine("Press any key for exit...");
Console.ReadKey();
}
Pay attention on second comment (output) in my code, please. I get this result (
found 54, fixed 54) every time (
for the same resaved DWG file even), but AutoCAD 2015 find nothing. It happens not for this DWG file only but for many other. Why Teigha find errors every time for the same DWG?
Thank you.