Associative dimensions are implemented through the following classes:
OdDbDimAssoc — The main class used to associate dimensions with geometry.
OdDbOsnapPointRef — Class for storing snap point information.
OdDbDimAssoc Class
This class implements a reactor for database entities and for the dimension entity.
An OdDbDimAssoc object resides in extension dictionary of associative dimension entity under ACAD_DIMASSOC key.
OdDbLeader and OdDbMLeader entities also can be associative and have OdDbDimAssoc object
in their extension dictionary.
Hierarchy for OdDbDimAssoc object in a database
The OdDbDimAssoc class is responsible for:
Recalculating OdDbDimension, OdDbLeader, and OdDbMLeader entities when a source entity is modified.
Breaking associativity when a source entity's geometry is modified explicitly.
Proceeding with required actions when source entities are cloned or erased.
Storing OdDbOsnapPointRef objects, referencing to snap points.
OdDbOsnapPointRef Class
This class is used to reference an OdDbOsnapPoint object, which stores information about
associativity between the dimension and the entity it is associated with.
The OdDbOsnapPointRef class is responsible for:
Encapsulating snap point information.
Recalculating new point positions using snap information, if snapped entity was modified.
Snap point information includes:
Snap point mode (see the table of supported snap modes below).
Full Subentity Path to main entity.
Full Subentity Path to intersection entity (for intersection snap modes).
Parameter of OdDbCurve (for nearest point snap mode).
Previous snap point position (if snap point mode assumes it).
Reference to last point (for Tangent and Perpendicular modes).
Supported snap modes
Identifier
Value
Snap mode
OdDb::kOsModeEnd
1
End Point
OdDb::kOsModeMid
2
Mid Point
OdDb::kOsModeCen
3
Center
OdDb::kOsModeNode
4
Node
OdDb::kOsModeQuad
5
Quadrant
OdDb::kOsModeIntersec
6
Intersection
OdDb::kOsModeIns
7
Insertion point
OdDb::kOsModePerp
8
Perpendicular
OdDb::kOsModeTan
9
Tangent
OdDb::kOsModeNear
10
Nearest
OdDb::kOsModeApint
11
Apparent intersection
OdDb::kOsModePar
12
Parallel
OdDb::kOsModeStart
13
Start Point
Full Subentity Path
The full subentity path is used for identifying a subentity within a particular entity.
It consists of an array of object IDs and a SubentityId object. The subentity object ID contains
a graphical system marker of the subentity and the type of subentity. The object ID array contains
a sequential list of the object IDs for all the objects that are included in the "path"
from the outermost entity.
If an entity is directly owned by model space or paper space BlockTableRecords, the object ID array will have only one item
(the entity's object ID).
Such entities as Block References and Viewports can be present in the path.
The functionality of OdDbOsnapPointRef can be used in different entity classes, including custom ones.