Modifying Dimensions
Methods Introduced:
The method
wfcDimension.WDimension.SetBound sets the bound status of the dimension using the enumerated type
wfcDimension.DimBound. The valid values are:
• DIM_BOUND_NOMINAL—Sets the dimension value to the nominal value. It generates geometry based on exact ideal dimensions.
• DIM_BOUND_UPPER—Sets the dimension value to its maximum value. It generates geometry based on a nominal dimension value plus the tolerance.
• DIM_BOUND_LOWER—Sets the dimension value to its minimum value. It generates geometry based on a nominal dimension value minus the tolerance.
• DIM_BOUND_MIDDLE—Sets the dimension value to the nominal value plus the mean of the upper and lower tolerance values.
The methods
wfcDimension.WDimension.SetAsBasic and
wfcDimension.WDimension.SetAsInspection set the basic and inspection notations of the dimension respectively. These methods are applicable to both driven and driving dimensions.
|
|
The basic and inspection notations of the dimension are not available when only the tolerance value for a dimension is displayed.
|
The method
wfcDimension.WDimension.SetOverrideValue assigns the override value for a dimension. This value is restricted to real numbers. The default override value is zero.
|
|
You can set the override value only for driven dimensions.
|
The method
wfcDimension.WDimension.SetDisplayedValueType sets the type of value to be displayed for a dimension using the enumerated data type
wfcDimension.DimValueDisplay.
The method
wfcDimension.WDimension.SetElbowLength sets the length of the elbow for the specified dimension in a solid. The method can also be used to set the length of the elbow for a dimension in a drawing, where the dimension is created in a solid and is displayed in a drawing. To work with dimensions shown in a drawing, pass the name of the drawing in the input argument
Drw.
The method
wfcDimension.WDimension.CreateSimpleBreak creates a simple break on an existing dimension witness line. The input arguments are:
• Drawing—Specifies the drawing in which the dimension is present. You can specify a NULL value.
|
|
This argument is not applicable for ordinate, radius, and diameter dimensions.
|
• BreakStart—Specifies the start point of the break.
• BreakEnd—Specifies the end point of the break.
The method
wfcDimension.WDimension.CreateJog creates a jog on an existing dimension witness line. The input arguments are:
• Drawing—Specifies the drawing in which the dimension is present. You can specify a NULL value.
|
|
This argument is not applicable for ordinate, radius, and diameter dimensions.
|
• JogPoints—Specifies an array of points to position the jog. If the specified witness line has no jog added to it, then you must specify minimum two points that is, the start point and end point of the jog.
|
|
The methods wfcDimension.WDimension.CreateSimpleBreak and wfcDimension.WDimension.CreateJog throw an exception pfcExceptions.XToolkitInvalidType when breaks and jogs are not supported for the specified dimension type, for example, diameter dimension. The methods throw an exception pfcExceptions.XToolkitAbort when it is not possible to create breaks or jogs for the specified dimension witness line. For example, if you add a jog that is duplicate to an existing jog on the dimension witness line.
|
When you create a dimension, witness lines are created based on the dimension placement location and dimension references. These witness lines do not overlap with the reference geometry.
The method
wfcDimension.WDimension.EraseWitnessLine erases a specified witness line from the dimension. The input arguments are:
• Drawing—Specifies the drawing in which the dimension is displayed. To erase witness line from a solid, specify this argument as NULL.
Use the method
wfcDimension.WDimension.ShowWitnessLine to show the erased witness line for the specified dimension.
The method
wfcDimension.WDimension.SetSignificantDigits sets the number of decimals digits that are significant for a dimension or tolerance. If you specify the input argument
Tolerance as
false, the method sets the number of decimal places for a decimal dimension.
• If the number of decimal places required to display the stored value of the dimension is greater than the number of decimal places specified in the method
wfcDimension.WDimension.SetSignificantDigits and the round displayed value attribute of the dimension is ON, the stored value is unchanged. Only the displayed number of decimal places is changed and the displayed value is updated accordingly. For example, consider a dimension with its stored value as 12.12323 and the round displayed value attribute of the dimension is set to ON. If the method
wfcDimension.WDimension.SetSignificantDigits sets the number of decimal places to 3, the stored value of the dimension is unchanged, that is, the stored value will be 12.12323. The displayed value of the dimension is rounded to 3 decimal places, that is, 12.123. The round displayed value attribute is not changed.
• If the number of decimal places required to display the stored value of the dimension is greater than the number of decimal places specified in the method
wfcDimension.WDimension.SetSignificantDigits and the round displayed value attribute of the dimension is OFF, the number of decimal places of the dimension is modified and the stored value is rounded to the specified number of decimal places. For example, consider a dimension with its stored value as 12.12323 and the round displayed value attribute of the dimension is OFF. If the method
wfcDimension.WDimension.SetSignificantDigits sets the dimension to 3 decimal places, then the stored value of the dimension is rounded to 3 decimal places and is modified to 12.123. The dimension is displayed as 12.123.
• If the number of decimal places required to display the stored value of the dimension is less than the number of decimal places specified in the method
wfcDimension.WDimension.SetSignificantDigits, the number of decimal places is set to the specified value. The status of the round displayed value attribute is not considered, as no change or an increase to the number of decimal places will have no effect on the stored value. For example, consider a dimension with its stored value as 12.12323. If the method
wfcDimension.WDimension.SetSignificantDigits sets the dimension to 8 decimal places and if trailing zeros are displayed, then the dimension is displayed as 12.12323000.
For a driven dimension:
• If the number of decimal places set by the method is greater than or equal to the number of decimal places required to display the stored value of the dimension, the decimal places value is changed and no change to the round displayed value attribute is made.
• If the number of decimal places of the dimension is less than the number required to display the stored value of the dimension, the round displayed value attribute is automatically set to ON as it is not possible to change the stored value of a driven dimension.
If you want to set the number of decimal places shown for the upper and lower values of the dimension tolerance, specify the input argument Tolerance as true. Thus, the decimals of the dimension tolerance can be set independent of the number of dimension decimals. By default, the number of decimal places for tolerance values is calculated based upon the “linear_tol” settings of the model.
|
|
Specify a non-negative number as input for the argument Digits in the method wfcDimension.WDimension.SetSignificantDigits. It should be such that when you apply either the upper or lower values of tolerance to the given dimension, the total number of digits before and after the decimal point in the resulting values must not exceed 13.
|
The method
wfcDimension.WDimension.SetDenominator sets the denominator for fractional dimensions and tolerances. If you specify the input argument
Tolerance as
false, the method sets the denominator for fractional dimensions. When you call the method
wfcDimension.WDimension.SetDenominator:
• The stored value remains unchanged if,
◦ it can be expressed as an exact fraction with the given denominator, regardless of whether the round-off attribute is set or not.
◦ the stored value cannot be expressed as an exact fraction, but the round-off attribute is set. In this case, the fraction is the approximate representation of the stored value.
• The stored value changes to the nearest fraction and triggers a regeneration of the model, if it cannot be expressed as an exact fraction with the given denominator and the round-off attribute is not set.
If you want to set the value for the largest possible denominator for the upper and lower tolerance values, specify the input argument Tolerance as true. By default, this value is defined by the config.pro option, dim_fraction_denominator.
Use the method
wfcDimension.WDimension.SetDimensionArrowType to set the style for the arrow head of a leader for a specified dimension. The input arguments are:
• ArrowIndex—Specifies the index of the witness line. Depending on which side of the dimension the witness line lies, specify the value as
1 or
2. For diameter dimensions, this value determines which of the two arrows to change. For other dimensions, the value of
1 indicates the arrow on the first witness line, and the value of 2 indicates the arrow on the second witness line. For ordinate and radius dimensions, this value is ignored. Use the method
wfcDimension.DimLocation.GetFirstWitnessLineLocation or
wfcDimension.DimLocation.GetSecondWitnessLineLocation to get the location of the witness line end points for a dimension.
• ArrowType—Specifies the type of arrow head using the enumerated data type wfcAnnotation.LeaderArrowType.
• Drawing—Optional argument. Specifies the name of the drawing. For dimensions created in drawing mode and owned by a solid, which can be displayed only in the context of that drawing, specify the name of the drawing in the input argument drawing.
The function
wfcDimension.WDimension.GetEnvelope returns the envelope of a line in the specified dimension. While retrieving coordinates of the dimension in a specified solid, if the dimension is displayed in the solid as well as in the drawing, the drawing must not be active. The input arguments follow:
• drawing—The value for this input argument must be passed only if the solid dimension is shown in the drawing. Else, pass it as NULL.
• line—The line number of the dimension.
The method
wfcDimension.WDimension.SetDimensionWitnessLine sets the dimension information when annotation is attached to its witness line.
The method
wfcDimension.WDimension.SetDimensionArrow fills the selection if the dimension arrow has an offset.
• WitnessLineSide—Specifies the side of the selected dimension.
• Location—Specifies the pfcBase.Point3D location of the attached dimension, which may be offset from the dimension arrow.
The method
wfcDimension.WDimension.UpdateTangentAttachment updates the dimension to take the minimum, maximum, or center distance between the tangent lines of the arcs. The tangent type is specified using the enumerated data type
wfcDimension.DimArcAttachType and the valid values are:
• DIM_TANGENT_MIN—Sets the dimension line at the minimum distance on the arc.
• DIM_TANGENT_MAX—Sets the dimension line at the maximum distance on the arc.
• DIM_TANGENT_CENTER—Sets the dimension line at the center of the arc.
First or second tangent is specified using the enumerated data type wfcDimension.DimArcAttachType and the valid values are:
• DIM_TANGENT_FIRST
• DIM_TANGENT_SECOND
The method
wfcDimension.WDimension.GetTangentAttachment gets the dimension to take the minimum, maximum, or center distance between the tangent lines of the arcs. The tangent type is specified using the enumerated data type
wfcDimension.DimArcAttachType and the valid values are:
• DIM_TANGENT_MIN—Sets the dimension line at the minimum distance on the arc.
• DIM_TANGENT_MAX—Sets the dimension line at the maximum distance on the arc.
• DIM_TANGENT_CENTER—Sets the dimension line at the center of the arc.
The method
wfcDimension.WDimension.GetBaselineDirection retrieves the direction of an ordinate baseline dimension when it is not implied from the attachment reference returned by the method
wfcDimension.WDimension.GetDimensionAttachPoints.