Share

AcDbAssocDependency Class

Class Hierarchy

AcRxObject
    AcGiDrawable
        AcDbObject
            AcDbAssocDependency
                AcDbAssocGeomDependency
                AcDbAssocValueDependency

C++

class AcDbAssocDependency : public AcDbObject;

File

AcDbAssocDependency.h

Description

AcDbAssocDependency represents information about which AcDbAssocAction objects depend on or modify which AcDbObject. This is how associativity in the drawing is represented. Dependencies are owned by actions and are attached to the objects as persistent reactors. When the depended-on object changes, it notifies the dependency via the persistent reactor mechanism. The dependency checks whether the change is relevant, such as when the dependency is on an endpoint of a line and the color of the line changed, or the other endpoint changed, and if yes, it changes its status indicating that it needs to be evaluated, and also changes the status of the owning action, indicating that it needs to be evaluated (and the action changes the status of the AcDbAssocNetwork that owns it).

The base AcDbAssocDependency class can be used as is. A few concrete derived dependency classes are also provided that represent specialized kinds of dependencies, on particular objects or sub-objects, such as on subentities (faces, edges, vertices) of geometric entities, on objects that provide a numerical value, etc.

For example, the dependency on a subentity of a geometric entity keeps the AcDbAssocPersSubentId of the subentity and the cached subentity geometry (such as the [x,y,z] of a vertex subentity, the AcDbCurve of an edge subentity, etc.). It can then check whether the subentity really changed by obtaining the subentity geometry from the geometric entity and comparing it with the cached geometry. If they are the same, the change notification is ignored.

A better way to add a custom dependency class is to derive a custom AcDbAssocDependencyBody class (see AcDbAssocDependencyBody Class) and make objects of this class owned by the parent AcDbAssocDependency objects. The relation between AcDbAssocDependency and AcDbAssocDependencyBody classes is analogous to the relation between AcDbAssocAction and AcDbAssocActionBody classes. In particular, the dependency body is fully owned by its parent dependency, such as when the parent dependency is erased, it also erases the owned dependency body. For more information, see AcDbAssocAction Class.

Links

AcDbAssocDependency Methods

Was this information helpful?