From AutoCAD 2015, you can programmatically audit the drawing file using the new Database API “Audit” . You can also try fixing the issues in the drawing file using API’s argument. This API is present in ObjectARX and .NET.
In ObjectARX – use Acad::ErrorStatus acedAudit(AcDbDatabase* , bool , bool ) API.
[CommandMethod("AuditTest")]
publicvoid AuditTest() // This method can have any name
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
try
{
//to fix the error or not
bool bFixErrors = true;
//to show the message in commandline or not
bool becho = true;
//call audit API
doc.Database.Audit(bFixErrors, becho);
}
catch
{
ed.WriteMessage("Unable to audit the drawing\n");
}
}
publicvoid AuditTest() // This method can have any name
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
try
{
//to fix the error or not
bool bFixErrors = true;
//to show the message in commandline or not
bool becho = true;
//call audit API
doc.Database.Audit(bFixErrors, becho);
}
catch
{
ed.WriteMessage("Unable to audit the drawing\n");
}
}