Drawings SDK Developer Guide > Working with .dwg Files > Working with Entities > Working with Specific Entitites > Working with Dimensions > Overview of Dimensions > Overview of Angular Dimensions
Overview of Angular Dimensions

Angular dimensions measure and represent an angle in degrees, radians, or grads. There are two kinds of angular dimension entities:

  • Two-line angular dimension — Requires four points: the start point and end point of the first definition line, and the start point and end point of the second definition line, between which the angle is measured.

    To define the placement, the two-line angular dimension entity requires the first start point from which the first definition line begins, the first end point where the first definition line ends and the first extension line begins, the second start point from which the second definition line begins, the second end point where the second definition line ends and the second extension line begins, an on-line point through which the dimension lines pass, a text point that defines where to place the dimension text box, and the normal which orients the dimension in WCS.

  • Three-point angular dimension — Requires three points: the end point of the first definition line, the end point of the second definition line, and a vertex point that specifies the start point of both lines, between which the angle is measured.

    To define the placement, the three-point angular dimension entity requires the vertex point from which the two definition lines begin together, the first end point where the first definition line ends and the first extension line begins, the second end point where the second definition line ends and the second extension line begins, an on-line point through which the dimension lines pass, a text point that defines where to place the dimension text box places, and the normal which orients a dimension in WCS. The vertex point is the crossing point of the definition lines.

An angular dimension entity can be rotated, scaled, and oriented in WCS.

Elements of an angular dimension

An angular dimension entity consists of the following elements:

  • Two dimension lines — Arcs that pass through the on-line point to the extension lines. Dimension lines can be placed inside or outside extension lines. When dimension lines are placed inside, the first dimension line is drawn from the middle to the first extension line, and the second dimension line is drawn from the middle to the second extension line. When dimension lines are placed outside, they are drawn from the outside towards the extension lines and can be either connected by the forced line or can be open-ended. Both dimension lines have color, lineweight, and linetype independent of the entity's properties. Each dimension line has its own visibility setting and arrowhead. Each arrowhead can be set either from the fixed list of arrowhead types or can be defined by a block. The size is the same for each arrowhead.
  • Two extension lines — Straight lines that pass through the end points of definition lines and directly from the start points to the dimension lines. The first extension line is drawn from the first end point to the end of the first dimension line. The second extension line is drawn from the second end point to the end of the second dimension line. Both extension lines can begin at an offset distance from the end points, and both extension lines can finish at an extended distance beyond the dimension lines. Both extension lines have color and lineweight independent of the entity's properties. Each extension line has its own visibility setting and linetype independent from the entity's properties. Each extension line can have individual length or a fixed length can be set for extension lines together.
  • Dimension text box — An angular structure that consists of the required measured value, optional tolerance, optional prefix, and optional suffix. The dimension text box can be centered between dimension lines or placed above dimension lines, can be aligned horizontally or along dimension or extension lines, can be offset on the gap from the dimension, extension, or leader line, can be rotated, and can be scaled.
  • Optional leader line — When the dimension text box is placed beyond the dimension or extension lines, the leader line can be drawn from the dimension line to the dimension text box margin. The leader line does not have an arrowhead and connects the dimension line to the dimension text box.

The common structure of an angular dimension entity is defined by the text movement, text fit, and text position relative to the dimension and extension lines (inside or outside).

Text movement

Dimension text can be moved, but the result can vary depending on the Dimtmove value. Dimtmove can be set to one of the following values:

  • 0 — When set to 0, the dimension text box is always placed either between or beside the dimension lines. If the dimension text box moves, the dimension lines also move, and vice versa, if the dimension lines move along the extension line, the dimension text box also moves. Extension lines are stationary.

    If there is not enough space between extension lines to place text and arrowheads, the text box, the arrowheads, or both the text box and arrowheads are placed automatically outside of the extension lines according to the current fit.

    When the dimension text box is placed inside and the arrowheads are placed outside, the dimension lines are drawn without extension lines.

    When the dimension text box is placed outside and the arrowheads are placed inside, the dimension lines are drawn together inside and the leader line is drawn outside, connecting the dimension line to the dimension text box.

    When the dimension text box and the arrowheads are placed outside, the dimension lines are drawn from the outside to the extension lines, including the leader line, and the forced line that connects the two dimension lines are drawn between the extension lines. The forced line can be omitted. If the dimension text box is placed above a dimension line, the leader line connects along the dimension text box.

  • 1 — When set to 1, the dimension text box can be placed independently from the dimension lines. The leader line is drawn from the middle of dimension lines to the dimension text box margin. The placement of dimension lines and arrowheads is defined by the available space between extension lines, as described above.

  • 2 — When set to 2, the dimension text box can be placed anywhere, independent of dimension line placement and movement. The leader line is not drawn.

For working with angular dimension objects, use the OdDb2LineAngularDimension and OdDb3PointAngularDimension classes, which represent two-line angular and three-point angular dimensions and allow users to access angular dimension entities and manipulate their properties. The OdDb2LineAngularDimensionPtr and OdDb3PointAngularDimensionPtr classes are the typified smart pointers to an instances of those entities, and they are used for storing and passing references to the angular dimension objects.

To create and initialize a new instance of an angular dimension entity, see Overview of Specific Entities.

The main methods of the OdDb2LineAngularDimension class are listed below:

  • xLine1Start() — Returns the start point of the first extension line as an object of the OdGePoint3d class.
  • setXLine1Start() — Sets a new start point of the first extension line; requires an object of the OdGePoint3d class as a new point.
  • xLine1End() — Returns the end point of the first extension line as an object of the OdGePoint3d class.
  • setXLine1End() — Sets a new end point of the first extension line; requires an object of the OdGePoint3d class as a new point.
  • xLine2Start() — Returns the start point of the second extension line as an object of the OdGePoint3d class.
  • setXLine2Start() — Sets a new start point of the second extension line; requires an object of the OdGePoint3d class as a new point.
  • xLine2End() — Returns the end point of the second extension line as an object of the OdGePoint3d class.
  • setXLine2End() — Sets a new end point of the second extension line; requires an object of the OdGePoint3d class as a new point.
  • arcPoint() — Returns the point defining the location of the dimension arc as an object of the OdGePoint3d class.
  • setArcPoint() — Sets a new point defining the location of the dimension arc; requires an object of the OdGePoint3d class as a new point.

The main methods of the OdDb3PointAngularDimension class are listed below:

  • xLine1Point() — Returns the start point of the first extension line as an object of the OdGePoint3d class.
  • setXLine1Point() — Sets a new start point of the first extension line; requires an object of the OdGePoint3d class as a new point.
  • xLine2Point() — Returns the start point of the second extension line as an object of the OdGePoint3d class.
  • setXLine2Point() — Sets a new start point of the second extension line; requires an object of the OdGePoint3d class as a new point.
  • centerPoint() — Returns the vertex of the angle being dimensioned as an object of the OdGePoint3d class.
  • setCenterPoint() — Sets a new vertex of the angle being dimensioned; requires an object of the OdGePoint3d class as a new point.
  • arcPoint() — Returns the point defining the location of the dimension arc as an object of the OdGePoint3d class.
  • setArcPoint() — Sets a new point defining the location of the dimension arc; requires an object of the OdGePoint3d class as a new point.

The next example demonstrates how to work with a three-point angular dimension entity.


// Create an arc to be dimensioned 
OdDbArcPtr pArc = OdDbArc::createObject();

// Set default setting to the arc
pArc->setDatabaseDefaults(pDb);
bBTR->appendOdDbEntity(pArc);

// Set arc data
OdGePoint3d center(6,6,0); 
pArc->setCenter(center);
pArc->setStartAngle(OdaToRadian(45.0));
pArc->setEndAngle(OdaToRadian(135.0));
pArc->setRadius(1);

// Create three-point angular dimension entity
OdDb3PointAngularDimensionPtr pDimension = OdDb3PointAngularDimension::createObject();

// Set default setting to the dimension
pDimension->setDatabaseDefaults(pDb);
bBTR->appendOdDbEntity(pDimension);
pDimension->setDatabaseDefaults(pDb);

// Set dimension center
pDimension->setCenterPoint(pArc->center());
// Set point on the dimension arc
pDimension->setArcPoint(pArc->center() + OdGeVector3d(pArc->radius() + 0.0, 1.0, 0.0));
// Set start point
OdGePoint3d startPoint;
pArc->getStartPoint(startPoint);
pDimension->setXLine1Point(startPoint);
// Set end point
OdGePoint3d endPoint;
pArc->getEndPoint(endPoint);
pDimension->setXLine2Point(endPoint);

The next example demonstrates how to work with a two-line angular dimension entity.


// Create center and vectors for definition lines
OdGePoint3d center(4,0,0); 
OdGeVector3d v1(0.5, 0.1, 0);
OdGeVector3d v2(0.6, 0.7, 0);
OdGeVector3d v3 = v2 + OdGeVector3d(0.5, 1.0, 0.0);

// Create the first definition line
pLine1 = OdDbLine::createObject();
pLine1->setDatabaseDefaults(pDb);
bBTR->appendOdDbEntity(pLine1);
pLine1->setStartPoint(center + v1);
pLine1->setEndPoint  (center + v2);

//  Rotate the vectors to create the second definition line
double rot = OdaToRadian(60.0);
v1.rotateBy(rot, OdGeVector3d::kZAxis);
v2.rotateBy(rot, OdGeVector3d::kZAxis);

// Create the second definition line
OdDbLinePtr pLine2 = OdDbLine::createObject();
pLine2->setDatabaseDefaults(pDb);
bBTR->appendOdDbEntity(pLine2);
pLine2->setStartPoint(center + v1);
pLine2->setEndPoint  (center + v2);

// Create the two-line angular dimension entity
OdDb2LineAngularDimensionPtr pDimension = OdDb2LineAngularDimension::createObject();
// Set default setting to the dimension
bBTR->appendOdDbEntity(pDimension);
pDimension->setDatabaseDefaults(pDb);

// Set the point for the dimension arc
v3.rotateBy(rot/2.0, OdGeVector3d::kZAxis);  
pDimension->setArcPoint(center + v3);

// Set the start and end point of the first definition line
pLine1->getStartPoint(startPoint);
pDimension->setXLine1Start(startPoint);

pLine1->getEndPoint(endPoint);
pDimension->setXLine1End(endPoint);
  
// Set the start and end point of the second definition line
pLine2->getStartPoint(startPoint);
pDimension->setXLine2Start(startPoint);
  
pLine2->getEndPoint(endPoint);
pDimension->setXLine2End(endPoint);

See Also

Working with Dimensions

Overview of Dimensions

Overview of Linear Dimensions

Overview of Arc-Length Dimensions

Overview of Diametric Dimensions

Overview of Ordinate Dimensions

Overview of Radial Dimensions

Overview of Radial Large Dimensions

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