Arc dimensions measure and represent the length of a circular arc as a dimension entity in primary and alternate units. To define the placement, the arc dimension entity requires the center point of the arc to measure, start point from which the arc begins, end point in which the arc finishes, first extension point through which the first extension line passes, second extension point through which the second extension line passes, point on the arc through which the dimension lines pass, text point in which the dimension text box is placed, and the normal which orients the dimension in WCS. The center point, start point, and end point define the definition arc. An arc dimension entity can be rotated, scaled, and oriented in WCS.
An arc dimension entity consists of the following elements:
The common structure of the arc dimension entity is defined by the text movement, text fit, and the text position relative to the dimension and extension lines (inside or outside).
Dimension text can be moved, but the result can vary depending on the Dimtmove value. Dimtmove can be set to the following values:
For working with arc dimension objects, use the OdDbArcDimension class, which represents an arc dimension entity and manipulates its properties. The OdDbArcDimensionPtr class is the typified smart pointer to an instance of this entity and is used for storing and passing a reference to the arc dimension object.
To create and initialize a new instance of an arc dimension entity, see Overview of Specific Entities.
The main methods of the OdDbArcDimension class are listed below:
The next example demonstrates how to work with an arc dimension entity.
// Create an arc to be dimensioned
OdDbArcPtr pArc = OdDbArc::createObject();
pArc->setDatabaseDefaults(pDb);
bBTR->appendOdDbEntity(pArc);
// Set Arc properties
OdGePoint3d center(7, 0, 0);
pArc->setCenter(center);
pArc->setStartAngle(OdaToRadian(0.0));
pArc->setEndAngle(OdaToRadian(100.0));
pArc->setRadius(2.0);
// Create an Arc Dimension
OdDbArcDimensionPtr pDimension = OdDbArcDimension::createObject();
// Set default setting to the dimension
pDimension->setDatabaseDefaults(pDb);
bBTR->appendOdDbEntity(pDimension);
pDimension->setDatabaseDefaults(pDb);
// Set center
pDimension->setCenterPoint(pArc->center());
// Set arc point
pDimension->setArcPoint(pArc->center() + OdGeVector3d(pArc->radius() + 2.0, 0.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);
// Set Arc symbol before the dimension text
pDimension->setArcSymbolType(0);
// Add arc-leader
pDimension->setHasLeader(true);
Overview of Angular Dimensions
Overview of Diametric Dimensions
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.
|