Description
Abstract base class for deriving custom action body classes that implement functionality of custom actions.
An object of a class derived from the AssocActionBody class is always owned by a parent AssocAction object. The AssocAction object has an HardOwnershipId on it and the AssocActionBody.OwnerId() of the object returns the ObjectId of its parent AssocAction object.
Therefore a custom action object (in the logical sense of the word "object") is always represented by a pair of physical Objects:
- The parent action object of the AssocAction class (or possibly, but less commonly, of a derived class).
- The action body object of a custom class derived from the AssocActionBody abstract base class.
The abstract AssocActionBody base class defines a set of virtual methods named xxxxxxOverride() that correspond to methods named xxxxxx() in the parent AssocAction 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 AssocActionBody 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 other xxxxxxOverride() methods will do nothing and the default implementation in the parent AssocAction 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 ObjectIds of the AssocDependencies, these should be serialized as HardPointerIds, not as HardOwnershipIds, because the AssocDependencies are owned (in the AutoCAD database sense) by the parent AssocAction object, not by the custom action body object.
Because each AssocActionBody object is owned by its parent AssocAction object, erasing the parent AssocAction object also erases the owned AssocActionBody object. There is no need to erase AssocActionBody objects explicitly.
Class Hierarchy
Autodesk.AutoCAD.DatabaseServices.DBObject Autodesk.AutoCAD.DatabaseServices.AssocActionBody Autodesk.AutoCAD.DatabaseServices.AssocParamBasedActionBody
C#
public abstract class AssocActionBody : DBObject;
Visual Basic
Public abstract Class AssocActionBody Inherits DBObject
Links
AssocActionBody Structures, AssocActionBody Methods, AssocActionBody Properties