Adding Section Dimensions
 
Functions Introduced:
When you create a dimension interactively in Sketcher mode, you select entities and points on entities and Creo Parametric deduces from those picks what type of dimension is being added. When you add a dimension using the function ProSecdimCreate(), you must specify the dimension type. The dimension types are defined in the include file ProSecdimTypes.h. The following table lists the possible values.
Constant
Description
PRO_TK_DIM_LINE
Length of a line
PRO_TK_DIM_LINE_POINT
Distance between a line and a vertex
PRO_TK_DIM_RAD
Radius of an arc or a circle
PRO_TK_DIM_DIA
Diameter of an arc or a circle
PRO_TK_DIM_LINE_LINE
Distance between two lines
PRO_TK_DIM_PNT_PNT
Distance between two points
PRO_TK_DIM_PNT_PNT_HORIZ
Distance between two points (X coordinates)
PRO_TK_DIM_PNT_PNT_VERT
Distance between two points (Y coordinates)
PRO_TK_DIM_AOC_AOC_TAN_HORIZ
Horizontal distance between two arcs or circles
PRO_TK_DIM_AOC_AOC_TAN_VERT
Vertical distance between two arcs or circles
PRO_TK_DIM_ARC_ANGLE
Angle of an arc
PRO_TK_DIM_LINES_ANGLE
Angle between two lines
PRO_TK_DIM_LINE_AOC
Distance between a line and an arc or a circle
PRO_TK_DIM_LINE_CURVE_ANGLE
Angle between a spline and a line
PRO_TK_DIM_3_PNT_ANGLE
Angular dimension defined by three points
PRO_TK_DIM_DIA_LINEAR
Linear diameter dimension
PRO_TK_DIM_PNT_PNT_ORI
Distance between two points in specified orientation
PRO_TK_DIM_AOC_AOC_ORI
Distance between two arcs or circles in specified orientation
PRO_TK_DIM_TOT_INC_ANG
Total included angle
PRO_TK_DIM_ANG_POLAR
Angle between the x-axis and a vector. The vector is defined by two points
The function ProSecdimCreate() takes several input arguments, including the following:
int entity_ids[]—An array of integers that are the identifiers of the section entities to which the dimension refers.
ProSectionPointType point_types[]—A dimension can reference a vertex (the end of an entity), the center of an arc or a circle, a line or circle itself (the whole entity), or tangent points on an arc or a circle. To specify these types of dimension reference points, specify the appropriate point type constant for each dimension in the entity_ids array. These constants are listed in the include file ProSecdimType.h.
int num_ids—The number of section dimension identifiers in the entity_ids array. This is typically 1 or 2 (line length versus a point-to-point dimension).
ProSecdimType dim_type—The type of section dimension to create, as listed in the ProSecdimType.h file.
Pro2dPnt place_pnt—The two-dimensional location of the dimension label. This is equivalent to the middle mouse button pick when you are using Sketcher mode.
Note that the position of this label can sometimes determine the exact role of the dimension. For example, a dimension of type PRO_TK_DIM_LINES_ANGLE may refer to the acute or obtuse angle between two lines, depending on where the label is positioned.
The ProSecdimCreate() function outputs the identifier of the dimension, which is needed to identify the dimension if its value needs to be changed at a later time.
Note:
 
The dimensions do not need to be given values to create a complete and correct section of any form. See the section Solving and Regenerating a Section for a detailed explanation of the assignment of values.
The following code fragment shows how to create a dimension for the length of a line entity.
int line_id[1], width_dim;
Pro2dPnt point;
ProSectionPointType pnt_type[1];

line_id[0] = 1;
point[0] = 5.0;
point[1] = 1.0;
pnt_type[0] = PRO_ENT_WHOLE;

ProSecdimCreate (section, line_id, pnt_type, 1,
PRO_TK_DIM_LINE, point,
&width_dim);
The following code fragment shows how to create a dimension for the horizontal distance between two arc ends.
int arc1_id, arc2_id, arc1_end2, arc2_end1,
dist_dim;
Pro2dPnt point;
int entities[2];
ProSectionPointType pnt_types[2];

pnt_types[0] = PRO_ENT_START;
pnt_types[1] = PRO_ENT_END;
entity[0] = arc1_end2;
entity[1] = arc2_end1;
point[0] = 5.0;
point[1] = 5.0;

ProSecdimCreate (section, entities, pnt_types, 2,
PRO_TK_DIM_PNT_PNT_HORIZ, point, &dist_dim);
The ProSecdimDiam...() functions extend the dimension creation functionality to include diameters for sections used to create revolved features. Function ProSecdimDiamSet() converts a specified section dimension (between a centerline and another entity) into a diameter dimension. ProSecdimDiamClear() does the opposite, converting a diameter dimension into a regular one. Use function ProSecdimDiamInquire() to determine if a dimension is a diameter dimension.
The function ProSecdimStrengthen() converts a weak dimension to a strong dimension.
You can lock or unlock sketch dimensions. Locking of dimensions avoids modifications to the sections outside the sketcher mode. The function ProSecdimIsLocked() determines whether a sketch dimension is locked. Use the function ProSecdimLockSet() to lock or unlock a specified dimension.
這是否有幫助?