newer 发表于 2021-1-26 16:26:01

AUTOCAD 2015中新增的Audit API

问题:

Audit API - New in AutoCAD 2015

解答:

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.



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");
    }

}


页: [1]
查看完整版本: AUTOCAD 2015中新增的Audit API