About Adding Classification Support to the Standard

If you want your standard to work with classifications, you need to add an object of the type AecSpaceOffsetClassification to the standard after creating a resource set for the classification names. This class will handle all the classification-related functionality for the standard and within the implementation of the rule.

Initializing the Database with Classifications

The following example shows the required steps to populate the drawing the standard is applied to with the classification definitions. This must occur within the standard’s AecSpaceOffsetStandard.InitDatabase virtual base class method, because the classifications need to be added to each new drawing that uses this standard. The following example shows how a new AecSpaceOffsetClassification object is created and initialized into the currently active database:

namespace AecSpaceOffsetStandardISA
{
public class AecSpaceOffsetStandardISA: AecSpaceOffsetStandard
{
public AecSpaceOffsetClassification classification
public AecSpaceOffsetStandardISA()
{
}
protected override void InitDatabase(Database database)
{
classification = new AecSpaceOffsetClassification();
classification.Init(
database,
Assembly.GetExecutingAssembly(),
new CultureInfo(SystemObjects.DynamicLinker.ProductLcid, true);
"AecSpaceOffsetStandardISA.AecSpaceOffsetStandardISAClassifications",
"Classification Name"
);
}
}
}

The AecSpaceOffsetClassification.Init method is defined as:

public void Init(Database database, Assembly assembly, CultureInfo culture, string
resBaseName, string classificationSetName)

The first 3 arguments are usually identical in all cases. The first one is the database to which the classification set needs to be applied. The second argument is the current assembly that implements the standard plug-in. The third argument is the localization for which the classifications are to be set up (in the example, the current setting of AutoCAD Architecture 2022 toolset is used, which is the recommended procedure). The fourth argument is the name of the string table within the resources of the assembly. The last argument defines a name for the classification set in AutoCAD Architecture 2022 toolset. This should be localized too, because it will be visible to the user. However, this section focuses on classification handling only. When running the standard with the resource file set up correctly, the drawing should now contain classification definitions that apply only to spaces with the names defined in the resource’s string-table when the standard is assigned to the drawing.

BOMA classification inserted in drawing