Class Hierarchy
AcRxObject AcGiDrawable AcDbObject AcDbAssocActionBody AcDbAssocParamBasedActionBody
C++
class AcDbAssocActionBody : public AcDbObject;
File
AcDbAssocActionBody.h
Description
Abstract base class for deriving custom action body classes.
An object of a class derived from the AcDbAssocActionBody class is always owned by a parent AcDbAssocAction object. The AcDbAssocAction object has an AcDbHardOwnershipId on it and the AcDbAssocActionBody::ownerId() of the object returns the AcDbObjectId of its parent AcDbAssocAction object. Therefore a custom action object (in the logical sense of the word "object") is always represented by a pair of physical AcDbObjects:
- The parent action object of the AcDbAssocAction class (or, less commonly, of a derived class).
- The action body object of a custom class derived from the AcDbAssocActionBody abstract base class.
The abstract AcDbAssocActionBody base class defines a set of virtual methods named xxxxxxOverride() that correspond to methods named xxxxxx() in the parent AcDbAssocAction class. When a method xxxxxx() is called on the parent action object and the action object owns an action body object, the corresponding xxxxxxOverride() method on the action body object is called, and it either supersedes or amends the default xxxxxx() implementation, depending on the particular method. If the action object does not own an action body object, or if the action body object does not override the xxxxxxOverride() method, the default implementation in the parent action object is performed. Also, when the custom action body object becomes a proxy because its application code is not available, the parent action method just performs its default implementation.
Custom action body classes derived from the AcDbAssocActionBody class implement their behavior by overriding the appropriate xxxxxxOverride() methods. Only the evaluateOverride() method must always be overridden in the custom classes. If not overridden, the xxxxxxOverride() methods do nothing and the default implementation in the parent AcDbAssocAction object will be performed. This may be the appropriate behavior in most cases.
The custom action body classes also need to serialize their data. When serializing AcDbObjectIds of the AcDbAssocDependencies, these should be serialized as AcDbHardPointerIds, not as AcDbHardOwnershipIds, because the AcDbAssocDependencies are owned (in the AutoCAD database sense) by the parent AcDbAssocAction object, not by the custom action body object.
Because each AcDbAssocActionBody object is owned by its parent AcDbAssocAction object, erasing the parent AcDbAssocAction object also erases the owned AcDbAssocActionBody object. There is no need to erase AcDbAssocActionBody objects explicitly.