User's Guide > Drawings > Drawing Dimensions > Creating Drawing Dimensions
Creating Drawing Dimensions
Methods Introduced:
The method pfcDrawingDimCreateInstructions.Create() creates an instructions object that describes how to create a drawing dimension using the method pfcModel2D.CreateDrawingDimension().
The parameters of the instruction object are:
Attachments—The entities that the dimension is attached to. The selections should include the drawing model view.
IsRefDimension—True if the dimension is a reference dimension, otherwise null or false.
OrientationHint—Describes the orientation of the dimensions in cases where this cannot be deduced from the attachments themselves.
Senses—Gives more information about how the dimension attaches to the entity, i.e., to what part of the entity and in what direction the dimension runs. The types of dimension senses are as follows:
DIMSENSE_NONE
DIMSENSE_POINT
DIMSENSE_SPLINE_PT
DIMSENSE_TANGENT_INDEX
DIMSENSE_LINEAR_TO_ARC_OR_CIRCLE_TANGENT
DIMSENSE_ANGLE
DIMSENSE_POINT_TO_ANGLE
TextLocation—The location of the dimension text, in world units.
The method pfcModel2D.CreateDrawingDimension() creates a dimension in the drawing based on the instructions data object that contains information needed to place the dimension. It takes as input an array of pfcSelection objects and an array of pfcDimensionSense structures that describe the required attachments. The method returns the created drawing dimension.
The method pfcEmptyDimensionSense.Create() creates a new dimension sense associated with the type DIMSENSE NONE. The sense field is set to Type In this case no information such as location or direction is needed to describe the attachment points. For example, if there is a single attachment which is a straight line, the dimension is the length of the straight line. If the attachments are two parallel lines, the dimension is the distance between them.
The method pfcSplinePointDimensionSense.Create() creates a new dimension sense associated with the type DIMSENSE POINT which specifies the part of the entity to which the dimension is attached. The sense field is set to the value of the parameter PointType.
The possible values of PointType are:
DIMPOINT_END1— The first end of the entity
DIMPOINT_END2—The second end of the entity
DIMPOINT_CENTER—The center of an arc or circle
DIMPOINT_NONE—No information such as location or direction of the attachment is specified. This is similar to setting the PointType to DIMSENSE NONE.
DIMPOINT_MIDPOINT—The mid point of the entity
The method pfcTangentIndexDimensionSense.Create() creates a dimension sense associated with the type DIMSENSE_SPLINE_PT. This means that the attachment is to a point on a spline. The sense field is set to SplinePointIndex i.e., the index of the spline point.
The method pfcLinAOCTangentDimensionSense.Create() creates a new dimension sense associated with the type DIMSENSE_TANGENT_INDEX. The attachment is to a tangent of the entity, which is an arc or a circle. The sense field is set to TangentIndex, i.e., the index of the tangent of the entity.
The method pfcLinAOCTangentDimensionSense.Create() creates a new dimension sense associated with the type DIMSENSE_LINEAR_TO_ARC_OR_CIRCLE_TANGENT. The dimension is the perpendicular distance between the a line and a tangent to an arc or a circle that is parallel to the line. The sense field is set to the value of the parameter TangentType.
The possible values of TangentType are:
DIMLINAOCTANGENT_LEFT0—The tangent is to the left of the line, and is on the same side, of the center of the arc or circle, as the line.
DIMLINAOCTANGENT_RIGHT0—The tangent is to the right of the line, and is on the same side, of the center of the arc or circle, as the line.
DIMLINAOCTANGENT_LEFT1—The tangent is to the left of the line, and is on the opposite side of the line.
DIMLINAOCTANGENT_RIGHT1— The tangent is to the right of the line, and is on the opposite side of the line.
The method pfcPointToAngleDimensionSense.Create() creates a new dimension sense associated with the type DIMSENSE_ANGLE. The dimension is the angle between two straight entities. The sense field is set to the value of the parameter AngleOptions.
The possible values of AngleOptions are:
IsFirst—Is set to TRUE if the angle dimension starts from the specified entity in a counterclockwise direction. Is set to FALSE if the dimension ends at the specified entity. The value is TRUE for one entity and FALSE for the other entity forming the angle.
ShouldFlip—If the value of ShouldFlip is FALSE, and the direction of the specified entity is away from the vertex of the angle, then the dimension attaches directly to the entity. If the direction of the entity is away from the vertex of the angle, then the dimension is attached to the a witness line. The witness line is in line with the entity but in the direction opposite to the vertex of the angle. If the value of ShouldFlip is TRUE then the above cases are reversed.
The method pfcPointToAngleDimensionSense.Create() creates a new dimension sense associated with the type DIMSENSE_POINT_TO_ANGLE. The dimension is the angle between a line entity and the tangent to a curved entity. The curve attachment is of the type DIMSENSE_POINT_TO_ANGLE and the line attachment is of the type DIMSENSE POINT. In this case both the angle and the angle_sense fields must be set. The field sense shows which end of the curve the dimension is attached to and the field angle_sense shows the direction in which the dimension rotates and to which side of the tangent it attaches.
Was this helpful?