MIL_ID ContextId, | //in |
MIL_INT64 ToleranceType, | //in |
MIL_INT ToleranceLabel, | //in |
MIL_DOUBLE ValueMin, | //in |
MIL_DOUBLE ValueMax, | //in |
const MIL_INT *FeatureLabelArrayPtr, | //in |
const MIL_INT *SubFeatureIndexArrayPtr, | //in |
MIL_INT SizeOfArray, | //in |
MIL_INT64 ControlFlag | //in |
This function adds a geometric tolerance to the metrology template of the specified metrology context. This function can also modify an existing tolerance of a metrology template. To delete geometric tolerances, use MmetControl() with M_DELETE.
To add several geometric tolerances, you must call this function for each tolerance to add.
A geometric tolerance defines the acceptable deviation from the definition of a feature, or the acceptable relationship between multiple features. For example, you can add a geometric tolerance to the metrology template to specify that one feature must be a certain length, or that two features must be perpendicular. To add a feature, use MmetAddFeature().
When adding a geometric tolerance that requires a point, you can use a specific point subfeature of a measured multiple point feature by specifying its index with the SubFeatureIndexArrayPtr parameter. Note that you cannot do this for other features, including the measured multiple edgel feature, as it is always used as a group.
When adding a geometric tolerance, you must also set its minimum and maximum limit values with the ValueMin and ValueMax parameters. When defining the tolerance of one feature, these limits represent the acceptable deviation from the definition of the feature. For example, a segment's length tolerance can be between 90 and 100 pixels. For multiple features, these limits represent the valid range of acceptable values between the features. For example, the perpendicular tolerance between two segments can be +/- 0.05° (that is, 89.95° to 90.05°). You can also set warning values to alert you when the tolerance is close to its minimum and maximum limits, using MmetControl() with M_VALUE_WARNING_MIN and M_VALUE_WARNING_MAX.
When you call MmetCalculate(), the tolerance is calculated (for example, 95 pixels) and a status is assigned (for example, M_PASS). To retrieve the tolerance value or the status, use MmetGetResult() with M_TOLERANCE_VALUE or M_STATUS, respectively.
You can modify a geometric tolerance (using M_MODIFY) so that it is based on a new set of features or subfeatures. As well, using M_MODIFY, you can modify the upper and lower bounds of a tolerance.
If a calibration context is associated with the target image, set values in real-world units (for example, tolerance values and warning values, and positional values). Otherwise use pixel units. For more information, see the Camera calibration - overview section of Chapter 25: Calibrating your camera setup.
Specifies the identifier of the metrology context. The metrology context must have been previously allocated on the required system using MmetAlloc().
Specifies the type of geometric tolerance to add. The symbol of every tolerance type is in its description. You can draw this symbol using MmetDraw() with M_DRAW_TOLERANCE.
For adding geometric
tolerances
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ANGULARITY |
Adds an angularity tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CONCENTRICITY |
Adds a concentricity tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISTANCE_MAX |
Adds a maximum distance tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISTANCE_MIN |
Adds a minimum distance tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_LENGTH |
Adds a length tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_PARALLELISM |
Adds a parallelism tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_PERPENDICULARITY |
Adds a perpendicularity tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_POSITION_X |
Adds a positioning tolerance, along the X-direction of the specified reference frame. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_POSITION_Y |
Adds a positioning tolerance, along the Y-direction of the specified reference frame. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_RADIUS |
Adds a radius tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ROUNDNESS |
Adds a roundness tolerance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRAIGHTNESS |
Adds a straightness tolerance. (more details...) |
To modify a geometric tolerance, the ToleranceType parameter can be set to the following value.
For modifying a geometric
tolerance
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_MODIFY |
Modifies both the set of features which the tolerance is based on, and the upper and lower bounds of the tolerance. (more details...) |
Specifies the label of the target tolerance.
For labeling the tolerance
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies that MIL automatically selects the tolerance's label value. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies the label value. (more details...) |
Specifies the array that holds the label values of the features whose relationship to validate. The features must have already been added to the metrology template of the metrology context. To add a feature, use MmetAddFeature().
Specifies the array that holds the index values of the multiple features' subfeatures whose relationship the added tolerance will validate. For non-multiple features (single features), specify 0 as the index. If the tolerance validates the relationship between only single features (there are no multiple features), set SubFeatureIndexArrayPtr to M_NULL.
Specifies the size of the arrays that hold the information that will be used to add the geometric tolerance (FeatureLabelArrayPtr and SubFeatureIndexArrayPtr).
Header | Include mil.h. |
Library | Use mil.lib; milmetrol.lib. |
DLL | Requires mil.dll; milmetrol.dll. |