Visiting Dimensions
Functions Introduced:
The two visit functions
ProSolidDimensionVisit() and
ProDrawingDimensionVisit() conform to the usual style of visit functions. (Refer to section
Visit Functions in the section
Fundamentals.) A dimension is stored in a solid if it is a “shown” dimension, that is, if it was created automatically by as part of the feature definition. A dimension will also be stored in a solid if it was created in drawing mode while the
config.pro option
CREATE_DRAWING_DIMS_ONLY was set to
NO.
The function
ProDimensionSymbolGet() returns the symbol (the name) of the specified dimension.
The function
ProDimensionValueGet() returns the value of the dimension.
Some feature dimensions are dependent on dimensions of other features. To modify the dependent dimension, you must get the parent dimension and modify it. Use the function
ProDimensionParentGet() to get the parent dimension of the specified dependent dimension. For example, consider a sketch feature, which is used to create an extrude feature. In this case, the section dimensions of the extrude feature depend on the dimensions of the sketch feature. To modify the section dimensions of extrude feature, the dimensions of the sketch feature must be retrieved and modified.
|
Note:
|
Multiple dimensions may depend on a single parent dimension.
|
The function
ProDimensionTypeGet() returns the type of the dimension in terms of the following values:
• PRODIMTYPE_LINEAR
• PRODIMTYPE_RADIUS
• PRODIMTYPE_DIAMETER
• PRODIMTYPE_ANGLE
• PRODIMTYPE_ARC_LENGTH
• PRODIMTYPE_IPAR_INT
The function
ProDimensionNomvalueGet() returns the nominal value of a dimension. The function returns the nominal value even if the dimension is set to the upper or lower bound. The nominal value is returned in degrees for an angular dimension and in the system of units for other types of dimensions.
Use the function
ProDimensionIsDisplayRoundedValue() to determine whether the specified dimension is set to display its rounded off value.
In , a rounded off value is a decimal value that contains only the desired number of digits after the decimal point. For example, if a dimension has the stored value 10.34132 and you want to display only two digits after the decimal point, you must round off the stored value to two decimal places. Thus, rounding off converts 10.34132 to 10.34.
Use the function
ProDimensionDisplayRoundedValueSet() to set the attribute of the given dimension to display either the rounded off value or the stored value. You can use this function for all dimensions, except angular dimensions created prior to
Pro/ENGINEER Wildfire 4.0, ordinate baseline dimensions, and dimensions of type
DIM_IPAR_INT. For these dimensions, the functions returns an error status
PRO_TK_NOT_VALID.
If you choose to display the rounded off value, the function
ProDimensionDisplayedValueGet() retrieves the displayed rounded value of the specified dimension. Otherwise, it retrieves the stored value.
The function
ProDimensionOverridevalueGet() returns the override value for a dimension. The default override value is zero.
|
Note:
|
The override value is available only for driven dimensions.
|
Use the function
ProDimensionValuedisplayGet() to obtain the type of value displayed for a dimension. The valid types are:
• PRO_DIMVALUEDISPLAY_NOMINAL—Displays the actual value of the dimension along with the tolerance value.
• PRO_DIMVALUEDISPLAY_OVERRIDE—Displays the override value for the dimension along with the tolerance value.
• PRO_DIMVALUEDISPLAY_HIDE—Displays only the tolerance value for the dimension.
The function
ProDimensionIsFractional() returns whether the dimension is expressed in terms of a fraction rather than a decimal. If the dimension is decimal, the function
ProDimensionDecimalsGet() outputs the number of decimals digits that are significant; if the dimension is fractional, the function
ProDimensionDenominatorGet() returns the value of the largest possible denominator used to define the fractional value.
The function
ProDimensionIsReldriven() returns whether the dimension is driven by a relation.
The function
ProDimensionIsRegenednegative() returns whether the dimension really has a negative value in relation to its original definition. Dimensions are always displayed in with positive values, and
ProDimensionValueGet() will always return a positive value, so this function is needed to show whether a dimension has been “flipped” as a result of being assigned a negative value during the last regeneration.
The function
ProDimensionBoundGet() returns the bound status of a dimension.
The function
ProDimensionFeatureGet() has been deprecated. Use the function
ProDimensionOwnerfeatureGet() instead.
The function
ProDimensionOwnerfeatureGet() returns the feature that owns the specified dimension.
|
Note:
|
For dimensions or reference dimensions in annotation elements, the function ProDimensionOwnerfeatureGet() returns the annotation feature that directly owns the annotation element.
|
The function
ProDimensionIsAccessibleInModel() identifies if a specified dimension is owned by the model. By default, the dimension is accessible in the model.
When you set a negative value to a dimension, it will either change the dimension to this negative value, or flip the direction around its reference and show a positive value dimension instead. Use the function
ProDimensionIsSignDriven() to check this. The function returns the following values for the output argument
is_sign_driven:
• PRO_B_TRUE—When the negative sign in the dimension value is used to flip the direction.
• PRO_B_FALSE—When the negative sign is used to indicate a negative value, that is, the dimension is negative.
The configuration option show_dim_sign when set to yes allows you to display negative dimensions in the user interface.
When the option is set no, the dimensions always show positive value. However, in this case, if you set a negative value for the dimension, the direction is flipped.
|
Note:
|
Some feature types, such as, dimensions for coordinate systems and datum point offsets, always show negative or positive values, even if the option is set to no. These features do not depend on the configuration option.
|
The function
ProDimensionDisplayFormatGet() retrieves the format in which the specified dimension is displayed. The enumerated data type
ProDimensionDisplayFormat returns the following values:
• PRO_DIM_DISPLAY_DECIMAL—Specifies that the dimension is displayed in decimal format.
• PRO_DIM_DISPLAY_FRACTIONAL—Specifies that the dimension is displayed in fractional format.
For dimensions, sometimes it may be required to indicate the origin or start of measurement. The origin is indicated by placing the dimension origin symbol on the witness line. The function
ProDimensionOriginSideGet() retrieves the witness line which is set as the origin for a dimension. The output argument
dim_side returns the index of witness line. If dimension origin has not been set for the specified dimension, the argument returns
-1.
You can place annotations such as, geometric tolerances and datum feature symbol, on the witness lines of dimensions. The function
ProSelectionDimWitnessLineGet() gets information about the dimension which has an annotation attached to its witness line. You must get the input object
ProSelection from the annotation which is attached to the witness line. For example, if the leader of a geometric tolerance is attached to the witness line of a dimension, the
ProSelection object is returned by the function
ProGtolAttachLeadersGet(). The output arguments are:
• dimension—Specifies a pointer to the dimension which is associated with the selected witness line.
• wline_side—Specifies the index of the witness line to which the annotation is attached.
• location—Specifies the location on the witness line where the annotation is attached.
The function
ProSelectionDimArrowGet() receives information from a selection of a dimension arrow. The input argument
selection selects the dimension arrow. The output arguments are:
• dimension—Specifies an arrow for the selected dimension.
• wline_side—Specifies the side of the selected dimension.
• location—Specifies the ProPoint3d location of the attached dimension, which may be offset from the dimension arrow.
The function
ProSelectionDimArrowSet() fills the selection if the dimension arrow has an offset. The input arguments are as follows:
• dimension—Specifies an arrow for the selected dimension.
• wline_side—Specifies the side of the selected dimension.
• location—Specifies the ProPoint3d location of the attached dimension, which may be offset from the dimension arrow.
The output argument selection selects the dimension arrow.
Example 2: Changing the Displayed Value of Selected Model Dimension to Rounded or Non-Rounded
The sample code in the file UgDimDisplayRounded.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_dims, shows the displayed value of a selected model dimension to rounded/non-rounded.