Ordinate dimensions measure and represent the x-axis or y-axis distance from the specified origin to the defining point in primary and alternate units. To define the placement, the ordinate dimension entity requires the origin point from which the dimension will start, the definition point on which the dimension will end, leader end point to which the extension line is drawn, text point that defines the location of the dimension text box, and the normal which orients a dimension in WCS.
An ordinate dimension entity can be rotated, scaled, and oriented in WCS.
An ordinate dimension entity consists of the following elements (no dimension lines):
For working with ordinate dimension objects, use the OdDbOrdinateDimension class, which represents an ordinate dimension entity and manipulates its properties. The OdDbOrdinateDimensionPtr class is the typified smart pointer to an instance of this entity and is used for storing and passing a reference to the ordinate dimension object.
To create and initialize a new instance of an ordinate dimension entity, see Overview of Specific Entities.
The main methods of the OdDbOrdinateDimension class are listed below:
The next example demonstrates how to work with an ordinate dimension entity.
// Create the line to be dimensioned
OdDbLinePtr pLine = OdDbLine::createObject();
pLine->setDatabaseDefaults(pDb);
bBTR->appendOdDbEntity(pLine);
// Set line start and end points - origin and definition points for dimension
OdGePoint3d startPoint(0.0, -5.0, 0);
OdGePoint3d endPoint(2.0, -1.0, 0);
pLine->setStartPoint(startPoint);
pLine->setEndPoint(endPoint);
//Create the base ordinate dimension
OdDbOrdinateDimensionPtr pDimensionBase = OdDbOrdinateDimension::createObject();
// Set dimension defaults
bBTR->appendOdDbEntity(pDimensionBase);
pDimensionBase->setDatabaseDefaults(pDb);
//Set dimension parameters
OdGePoint3d leaderEndPoint;
leaderEndPoint = startPoint + OdGeVector3d(1.0, 0, 0.0);
pDimensionBase->setOriginstartPoint);
pDimensionBase->setDefiningPoint(startPoint);
pDimensionBase->setLeaderEndPoint(leaderEndPoint);
// Measure distance by Y-Axis
pDimensionBase->useYAxis();
//Create an ordinate dimension
OdDbOrdinateDimensionPtr pDimension = OdDbOrdinateDimension::createObject();
// Set dimension defaults
bBTR->appendOdDbEntity(pDimension);
pDimension->setDatabaseDefaults(pDb);
//Set dimension parameters
leaderEndPoint = endPoint + OdGeVector3d(3.0, 1.0, 0.0);
pDimension->setOrigin(startPoint);
pDimension->setDefiningPoint(endPoint);
pDimension->setLeaderEndPoint(leaderEndPoint);
// Measure distance by Y-Axis
pDimension->useYAxis();
Overview of Angular Dimensions
Overview of Arc-Length Dimensions
Overview of Diametric Dimensions
Overview of Radial Large Dimensions
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|