Close

Relief for ODA Team in Ukraine

Learn more
ODA Drawings SDK
Associative Dimensions Architecture

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::kOsModeEnd1End Point
OdDb::kOsModeMid2Mid Point
OdDb::kOsModeCen3Center
OdDb::kOsModeNode4Node
OdDb::kOsModeQuad5Quadrant
OdDb::kOsModeIntersec6Intersection
OdDb::kOsModeIns7Insertion point
OdDb::kOsModePerp8Perpendicular
OdDb::kOsModeTan9Tangent
OdDb::kOsModeNear10Nearest
OdDb::kOsModeApint11Apparent intersection
OdDb::kOsModePar12Parallel
OdDb::kOsModeStart13Start 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.

See Also

Working with Associative Dimensions

Creating Associative Dimensions

Recalculation of Associative Dimensions Implementation

Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.