About CAD Standards Workflow (ActiveX/CSP)

Developers of a plug-in need to be aware of the ways a user can audit a drawing and how to respond appropriately.

In all cases, the first step is for the plug-in to set an object filter array for one or more specific object types. After that, the process varies depending on the types of audit initiated.

Notification

Users can configure the CAD Standards feature to provide real-time feedback if they create nonstandard objects. In this case, the plug-in receives ObjectARX notification from AutoCAD. When the user creates objects of interest to the plug-in, the CAD Standards framework collects the objects and sends them to the plug-in.

The plug-in checks the objects for compliance and create an error object for each error. The framework gets the error objects and sends the error notification to the user. If the user chooses to fix the errors, the framework notifies the plug-in. The plug-in creates fix objects for each error and passes them back to the framework. The framework displays the fixes to the user. When the user selects a fix, the framework calls the ApplyFix method of the error object. This continues for all errors or until the user cancels the process.

CHECKSTANDARDS Command

The user can initiate an audit of a drawing using the AutoCAD CHECKSTANDARDS command. In this case, the CAD Standards framework passes the entire database to the enabled plug-ins. The plug-ins create error objects, and the framework gathers all possible fixes. The errors found are displayed one after another in a dialog box. When the user selects a fix, the framework calls the ApplyFix method of the error object. This continues until all errors are fixed or the user cancels the process.

The following outlines the methods and the order in which they are executed during the use of the CHECKSTANDARDS command:

Initialize()
GetObjectFilter()
SetupForAudit()
SetContext()
Start()
   [Check Standards dialog box is displayed]
  Next()
  Done()
Clear()

During the creation or opening of a drawing file, the CAD Standards framework executes several methods to support real-time checking. The methods and the order in which they are executed is as follows:

Initialize()
GetObjectFilter()
SetupForAudit()

When a CAD Standards plug-in is enabled in a drawing, the Clear method is executed.

Batch Standards Checker

The user can choose to check multiple drawings using the Batch Standards Checker. In this case, plug-ins may be specified in each drawing (the default) or in the Batch Standards Checker. The Batch Standards Checker (host application) manages the list of drawings to check.

The CAD Standards framework opens the drawings and passes them to interested plug-ins. The plug-ins create error and fix objects, which are collected by the framework. The Batch Standards Checker application walks through the resulting collections and creates a report, which displays the author and description fields for each plug-in.

Note: The Batch Standards Checker does not offer the option of applying fixes.

The following outlines the methods and order in which they are executed during the checking of errors with the Batch Standards Checker:

Initialize()
GetObjectFilter()
SetupForAudit()
SetContext()
Start()
  Next()
  Done()
WritePluginInfo()
CheckSysvar()
Clear()