Annotations: Geometric Tolerances
The methods in this section allow a Creo Object TOOLKIT C++ application to read, modify, and create geometric tolerances (gtols) in a solid or drawing. We recommend that you study the Creo Parametric documentation on geometric tolerances, and develop experience with manipulating geometric tolerances using the Creo Parametric commands before attempting to use these methods.
Reading Geometric Tolerances
Methods Introduced:
The method wfcGTol::GetGTolName retrieves the name of the geometric tolerance (gtol).
The method wfcGTol::GetTopModel retrieves the top model that owns the specified gtol. This will usually be the model that contains the gtol; but if the gtol was created in drawing mode and added to a solid in a drawing view, the owner will be the drawing, while the model is the solid.
The method wfcGTol::GetComposite retrieves the value and the datum references, that is, the primary, secondary, and tertiary references for the specified composite gtol.
The method wfcGTol::GetCompositeSharedReference checks if the datum references are shared between all the rows defined in the composite gtol.
The method wfcGTol::GetDatumReferences retrieves the primary, secondary, and tertiary datum references for a gtol.
The method wfcGTol::GetIndicators retrieves all the indicators assigned to the specified gtol.
The method wfcGTol::GetReferences retrieves a sequence of geometric entities referenced by the specified gtol. The entities are additional references used to create the gtol. This method supports only gtols that are not created as Annotation Elements.
The method wfcGTol::GetGTolType retrieves the type of gtol using the enumerated data type wfcGTolType. The various types of gtol, are straightness, flatness, and so on.
The method wfcGTol::IsBoundaryDisplay checks if the boundary modifier has been set for the specified gtol.
Use the method wfcGTol::GetUnilateralModifier to check if the profile boundary has been set to unilateral in the specified gtol. If set to unilateral, the method also checks if the tolerance disposition is in the outward direction of the profile.
The method wfcGTol::GetValueString retrieves the value specified in the gtol as a wchar_t* string.
The method wfcGTol::IsAllAround checks if the All Around symbol has been set for the specified gtol.
The method wfcGTol::IsAllOver checks if the All Over symbol has been set for the specified gtol. The All Over symbol and All Around symbol specifies that the profile tolerance must be applied to all the three dimensional profile of the part.
The method wfcGTol::IsAddlTextBoxed checks if a box has been created around the specified additional text in a geometric tolerance.
Deleting a Geometric Tolerance
Methods Introduced:
The method wfcGTol::Delete permanently removes a gtol.
Validating a Geometric Tolerance
Methods Introduced:
The method wfcGTol::Validate checks if the specified geometric tolerance is syntactically correct. For example, when a string is specified instead of a number for a tolerance value, it is considered as syntactically incorrect. The input argument Type is specified using the enumerated type wfcGTolValidityCheckType.
Geometric Tolerance Layout
The methods described in this section provide access to the layout for the text and symbols in a geometric tolerance.
Methods Introduced:
The method wfcGTol::GetElbow retrieves the length and direction of the geometric tolerance leader elbow.
The method wfcGTol::GetRightTextEnvelope retrieves the bounding box coordinates for the right text in a specified geometric tolerance.
The method wfcGTol::Get3DLineEnvelope retrieves the bounding box coordinates for one line from the geometric tolerance. The input argument LineNumber is the line number for which the bounding box coordinates are to be returned.
Note
The above methods support only gtols that are placed on an annotation plane.
Additional Text for Geometric Tolerances
You can place multi-line additional text to the right, left, bottom, and above a geometric tolerance control frame while creating and editing a gtol in both drawing and model modes.
Methods Introduced:
The method wfcGTol::GetBottomText retrieves the text added to the bottom of the specified geometric tolerance.
Use the method wfcGTol::SetBottomText to set the text to be added to the bottom of the specified geometric tolerance.
The method wfcGTol::GetLeftText retrieves the text added to the left of the specified geometric tolerance.
Use the method wfcGTol::SetLeftText to set the text to be added to the left of the specified geometric tolerance.
The method wfcGTol::GetRightText retrieves the text added to the right of the specified geometric tolerance.
Use the method wfcGTol::SetRightText to set the text to be added to the right of the specified geometric tolerance.
The method wfcGTol::GetTopText retrieves the text added to the top of the specified geometric tolerance.
Use the method wfcGTol::SetTopText to set the text to be added to the top of the specified geometric tolerance.
Geometric Tolerance Text Style
The methods described in this section access the text style properties of a geometric tolerance.
Methods Introduced:
The method wfcGTol::GetBottomTextHorizJustification retrieves the horizontal justification for the additional text applied to the specified geometric tolerance at the bottom.
The method wfcGTol::SetBottomTextHorizJustification sets the horizontal justification for the additional text applied to the specified geometric tolerance at the bottom. The input argument BottomTextHorizJustification is specified using the enumerated type pfcHorizontalJustification and the valid values are:
•  pfcH_JUSTIFY_LEFT—Specifies the left horizontal
•  pfcH_JUSTIFY_CENTER
•  pfcH_JUSTIFY_RIGHT
•  pfcH_JUSTIFY_DEFAULT
The method wfcGTol::GetTopTextHorizJustification retrieves the horizontal justification for the additional text applied to the specified geometric tolerance at the top.
The method wfcGTol::SetTopTextHorizJustification sets the horizontal justification for the additional text applied to the specified geometric tolerance at the top. The input argument TopTextHorizJustification is specified using the enumerated type pfcHorizontalJustification.
The method wfcGTol::GetAdditionaltextTextStyle retrieves the text style of the additional text applied to the specified geometric tolerance.
The method wfcGTol::SetGTolAdditionaltextTextStyle assigns the text style of the additional text applied to the specified geometric tolerance. The input parameters are:
•  Type—Specifies the text type of the additional text using the enumerated type wfcGTolTextType.
•  TextStyle—Specify the text style using the class pfcAnnotationTextStyle.
Use the method wfcGtol::GetAdditionalTextLocation to get the additional text location for the specified type of text. The input parameter Type is specified by the enumerated data type and the valid values are:
•  wfcGTOLTEXT_ON_RIGHT
•  wfcGTOLTEXT_ON_TOP
•  wfcGTOLTEXT_ON_BOTTOM
•  wfcGTOLTEXT_ON_LEFT
Creating a Geometric Tolerance
Methods Introduced:
The method wfcGTol::SetGTolType sets the type of geometric tolerance using the enumerated data type wfcGTolType.
The method wfcGTol::SetBoundaryDisplay sets the boundary modifier for the specified gtol.
Use the method wfcGTol::SetUnilateralModifier to set the profile boundary as unilateral in the specified gtol using the class wfcGTolUnilateralModifier.
The method wfcGTolUnilateralModifier::Create creates a unilateral modifier for a specified gtol.
Use the methods wfcGTolUnilateralModifier::GetOutside and wfcGTolUnilateralModifier::SetOutside to get and set the tolerance disposition to outward direction for the specified gtol.
Use the methods wfcGTolUnilateralModifier::GetUnilateral and wfcGTolUnilateralModifier::SetUnilateral to get and set the boundary modifier as unilateral for the specified gtol.
The method wfcGTol::SetValueString sets the specified value string for a gtol.
Use the method wfcGTol::AddReferences to add datum references to the specified gtol.
Use the method wfcGTol::DeleteReference to delete the datum references from the specified gtol.
The method wfcGTol::SetIndicators sets the indicators for the specified gtol. Specify the input argument indicators using the class wfcGTolIndicators.
Use the method wfcGTolIndicator::Create to create an indicator for a specified gtol. The input arguments are:
•  Type—Specify a sequence of indicator types.
•  Symbol—Specifies a sequence of strings for indicator symbols.
•  Df—Specifies a sequence of strings for datum feature symbols.
Use the methods wfcGTolIndicator::GetDFS and wfcGTolIndicator::SetDFS to get and set the strings for datum feature symbol.
Use the methods wfcGTolIndicator::GetSymbol and wfcGTolIndicator::SetSymbol to get and set the strings for indicator symbols.
Use the methods wfcGTolIndicator::GetType and wfcGTolIndicator::SetType to get and set the type of indicators using the enumerated type wfcGTolIndicatorType and the valid values are:
•  wfcGTOL_INDICATOR_DIRECTION_FEAT
•  wfcGTOL_INDICATOR_COLLECTION_PLANE
•  wfcGTOL_INDICATOR_INTERSECTION_PLANE
•  wfcGTOL_INDICATOR_ORIENTATION_PLANE
The method wfcGTol::SetElbow sets the elbow along with its properties for a leader type of gtol. This method is supported for leader type gtols which are placed on the annotation plane. The input argument elbowLength specifies the length of the elbow in model coordinates.
Use the method wfcGTolElbow::Create to create an elbow for a specified gtol. The input arguments are:
•  Length—Specifies the length of the elbow.
•  Direction—Specifies the direction of the elbow.
The methods wfcGTolElbow::GetDirection and wfcGTolElbow::SetDirection get and set the direction of the elbow in a specified gtol.
The methods wfcGTolElbow::GetLength and wfcGTolElbow::SetLength get and set the length of the elbow in a specified gtol.
Use the method wfcGTol::SetDatumReferences to set the datum references for the specified gtol using the class wfcGTolDatumReferences. The datum references are set as wchar_t* strings.
Use the method wfcGTolDatumReferences::Create to create a datum reference for a specified gtol.
Use the methods wfcGTolDatumReferences::GetPrimary and wfcGTolDatumReferences::SetPrimary to get and set the primary datum references of the gtol.
Use the methods wfcGTolDatumReferences::GetSecondary and wfcGTolDatumReferences::SetSecondary to get and set the secondary datum references of the gtol.
Use the methods wfcGTolDatumReferences::GetTertiary and wfcGTolDatumReferences::SetTertiary to get and set the tertiary datum references of the gtol.
Use the method wfcGTol::SetCompositeSharedReference to specify if datum references in a composite gtol must be shared between all the defined rows.
The method wfcGTol::SetComposite sets the value and datum references for the specified composite gtol using the class wfcGTolComposite.
Use the method wfcGTolComposite::Create to create a composite tolerance for a specified gtol.
Use the methods wfcGTolComposite::GetPrimary and wfcGTolComposite::SetPrimary to get and set the primary datum strings of the composite tolerance.
Use the methods wfcGTolComposite::GetSecondary and wfcGTolComposite::SetSecondary to get and set the secondary datum strings of the composite tolerance.
Use the methods wfcGTolComposite::GetTertiary and wfcGTolComposite::SetTertiary to get and set the tertiary datum strings of the composite tolerance.
Use the methods wfcGTolComposite::GetValue and wfcGTolComposite::SetValue to get and set the value datum strings of the composite tolerance.
The method wfcGTol::SetAllAround sets the All Around symbol for the specified geometric tolerance.
The method wfcGTol::SetAllOver sets the All Over symbol for the specified geometric tolerance.
The method wfcGTol::SetAddlTextBoxed creates a box around the specified additional text in a geometric tolerance. Boxes can be created around additional text added above and below the frame of the geometric tolerance. The input arguments are:
•  Type—Specifies the instance of additional text to access using the enumerated type wfcGTolTextType.
•  IsBoxed—Specifies if the additional text is boxed.
The method wfcGTol::GetNotes returns the detail notes that represent a geometric tolerance in the specified drawing. The method returns pfcDetailNoteItems array of drawing notes that represents the geometric tolerance.
Attaching the Geometric Tolerances
Methods Introduced:
  • wfcGTol::GetGTolAttach
  • wfcGTolAttach::GetType
  • wfcGTol::SetAttachFree
  • wfcGTolAttachFree::Create
  • wfcGTolAttachFree::GetLocation
  • wfcGTolAttachFree::SetLocation
  • wfcGTolAttachFree::GetAnnotationPlane
  • wfcGTolAttachFree::SetAnnotationPlane
  • wfcGTol::SetAttachLeader
  • wfcGTolAttachLeader::Create
  • wfcGTolAttachLeader::GetLocation
  • wfcGTolAttachLeader::SetLocation
  • wfcGTolAttachLeader::GetLeaders
  • wfcGTolAttachLeader::GetLeaders
  • wfcGTolAttachLeader::GetLeaderAttachType
  • wfcGTolAttachLeader::SetLeaderAttachType
  • wfcGTolAttachLeader::GetAnnotationPlane
  • wfcGTolAttachLeader::SetAnnotationPlane
  • wfcGTolAttachLeader::GetMissingLeaders
  • wfcGTolLeaderInstructions::Create
  • wfcGTolLeaderInstructions::GetSelection
  • wfcGTolLeaderInstructions::SetSelection
  • wfcGTolLeaderInstructions::GetType
  • wfcGTolLeaderInstructions::SetType
  • wfcGTolLeaderInstructions::GetIsZExtension
  • wfcGTolLeaderInstructions::GetZExtensionPoint
  • wfcGTol::SetAttachDatum
  • wfcGTolAttachDatum::Create
  • wfcGTolAttachDatum::GetDatum
  • wfcGTolAttachDatum::SetDatum
  • wfcGTol::SetAttachAnnotation
  • wfcGTolAttachAnnotation::Create
  • wfcGTolAttachAnnotation::GetAnnotation
  • wfcGTolAttachAnnotation::SetAnnotation
  • wfcGTol::SetAttachOffset
  • wfcGTolAttachOffset::Create
  • wfcGTolAttachOffset::GetOffset
  • wfcGTolAttachOffset::SetOffset
  • wfcGTolAttachOffset::GetOffsetRef
  • wfcGTolAttachOffset::SetOffsetRef
  • wfcGTol::SetAttachMakeDimension
  • wfcGTolAttachMakeDimension::Create
  • wfcGTolAttachMakeDimension::GetLocation
  • wfcGTolAttachMakeDimension::SetLocation
  • wfcGTolAttachMakeDimension::GetOrientHint
  • wfcGTolAttachMakeDimension::SetOrientHint
  • wfcGTolAttachMakeDimension::GetDimSenses
  • wfcGTolAttachMakeDimension::SetDimSenses
  • wfcGTolAttachMakeDimension::GetDimAttachments
  • wfcGTolAttachMakeDimension::SetDimAttachments
  • wfcGTolAttachMakeDimension::GetAnnotationPlane
  • wfcGTolAttachMakeDimension::SetAnnotationPlane
  • The method wfcGTol::GetGTolAttach retrieves all the attachment related information for a gtol using the class wfcGTolAttach.
    The method wfcGTolAttach::GetType retrieves the type of attachment for a specified gtol. It uses the enumerated data type wfcGTolAttachType to provide information about the placement of the gtol and has one of the following values:
    •  wfcGTOLATTACH_DATUM—Specifies that the gtol is placed on its reference datum.
    •  wfcGTOLATTACH_ANNOTATION—Specifies that the gtol is attached to an annotation.
    •  wfcGTOLATTACH_ANNOTATION_ELBOW—Specifies that the gtol is attached to the elbow of an annotation.
    •  wfcGTOLATTACH_FREE—Specifies that the gtol is placed as free. It is unattached to the model or drawing.
    •  wfcGTOLATTACH_LEADERS—Specifies that the gtol is attached with one or more leader to geometry such as, edge, dimension witness line, coordinate system, axis center, axis lines, curves, or surface points, vertices, section entities, draft entities, and so on. The leaders are represented using an opaque handle, wfcGTolAttachLeader.
    •  wfcGTOLATTACH_OFFSET—Specifies that the gtol frame can be placed at an offset from the following drawing objects: dimension, dimension arrow, gtol, note, and symbol.
    •  wfcGTOLATTACH_MAKE_DIM—Specifies that the gtol frame is attached to a dimension line.
    Use the method wfcGTol::SetAttachFree to set the attachment options for free type of gtol. The input argument Attach is specified using the class wfcGTolAttachFree.
    Use the method wfcGTolAttachFree::Create to create an attachment for a gtol that is placed free. The input arguments are:
    •  Location—Specifies the location of the gtol text in model coordinates.
    •  AnnotationPlane—Specifies the annotation plane in model coordinates.
    Use the methods wfcGTolAttachFree::GetLocation and wfcGTolAttachFree::SetLocation to get and set the location of the gtol text in a specified gtol using the class pfcPoint3D.
    Use the methods wfcGTolAttachFree::GetAnnotationPlane and wfcGTolAttachFree::SetAnnotationPlane to get and set the annotation plane in a specified gtol using the class wfcAnnotationPlane.
    Use the method wfcGTol::SetAttachLeader to set the attachment options for leader type of gtol. The input argument Attach is specified using the class wfcGTolAttachLeader.
    Use the method wfcGTolAttachLeader::Create to create an attachment for leader type of gtol. The input arguments are:
    •  LeaderAttachType—Specifies the attachment type for the leader.
    •  Leaders—Specifies a sequence of gtol leaders.
    •  Location—Specifies the location of gtol text in model coordinates.
    •  AnnotationPlane—Specifies the annotation plane. For gtols defined in drawing, it returns NULL.
    Use the methods wfcGTolAttachLeader::GetLocation and wfcGTolAttachLeader::SetLocation to get and set the location of the gtol text in a specified gtol using the class pfcPoint3D.
    Use the methods wfcGTolAttachLeader::GetLeaders and wfcGTolAttachLeader::SetLeaders to get and set the leaders in a specified gtol using the class wfcGTolLeaderInstructionsSeq.
    Use the methods wfcGTolAttachLeader::GetLeaderAttachType and wfcGTolAttachLeader::SetLeaderAttachType to get and set the type of leaders that can be attached in a specified gtol. The type of leaders is specified using the enumerated type wfcGTolLeaderAttachType and one of the valid values are:
    •  wfcGTOL_LEADER
    •  wfcGTOL_NORMAL_LEADER
    •  wfcGTOL_TANGENT_LEADER
    Use the methods wfcGTolAttachLeader::GetAnnotationPlane and wfcGTolAttachLeader::SetAnnotationPlane to get and set the annotation plane on which the leader is attached to the specified gtol. The plane is specified using the class wfcAnnotationPlane.
    Use the method wfcGTolAttachLeader::GetMissingLeaders to get the number of suppressed leaders due to missing references.
    Use the method wfcGTolLeaderInstructions::Create to create instructions for a leader type of gtol.
    The methods wfcGTolLeaderInstructions::GetSelection and wfcGTolLeaderInstructions::SetSelection get and set the selection of instructions for a leader type of gtol using the class pfcSelection.
    The methods wfcGTolLeaderInstructions::GetType and wfcGTolLeaderInstructions::SetType get and set the type of instructions for a leader type of gtol.
    The method wfcGTolLeaderInstructions::GetIsZExtension checks if the gtol leader has a Z-Extension line.
    The method wfcGTolLeaderInstructions::GetZExtensionPoint retrieves the Z-Extension line of the gtol leader. The leader location coordinates are required when the gtol is moved to a different annotation plane.
    Use the method wfcGTol::SetAttachDatum to set the attachment options for datum symbol type of gtol. The input argument Attach is specified using the class wfcGTolAttachDatum.
    Use the method wfcGTolAttachDatum::Create to create an attachment for a specified datum inside a gtol. The input argument Datum is specified using the pfcModelItem class.
    The methods wfcGTolAttachDatum::GetDatum and wfcGTolAttachDatum::SetDatum get and set the attachments for datum type of gtol.
    From Creo Parametric 4.0 F000 onward, datum symbols are defined using datum feature symbol. The methods work with the new datum feature symbol along with the legacy datum tag annotations.
    Use the method wfcGTol::SetAttachAnnotation to set the attachment options for annotation type of gtol. The input argument Attach is specified using the class wfcGTolAttachAnnotation.
    Use the method wfcGTolAttachAnnotation::Create to create an attachment for a specified annotation inside a gtol. The input argument Annotation is specified using the wfcAnnotation class.
    The methods wfcGTolAttachAnnotation::GetAnnotation and wfcGTolAttachAnnotation::SetAnnotation get and set the attachments for annotation type of gtol.
    Use the method wfcGTol::SetAttachOffset to set the offset references for the geometric tolerance. The input argument Attach is specified using the class wfcGTolAttachOffset.
    Use the method wfcGTolAttachOffset::Create to create an attachment for a gtol with offset references. The input arguments are:
    •  OffsetRef—Specifies the offset reference.
    •  Offset—Specifies the position of the offset reference as model coordinates.
    The methods wfcGTolAttachOffset::GetOffset and wfcGTolAttachOffset::SetOffset get and set the position of the offset reference as model coordinates using the class pfcVector3D.
    The methods wfcGTolAttachOffset::GetOffsetRef and wfcGTolAttachOffset::SetOffsetRef get and set the offset reference using the class pfcSelection. The reference can be a dimension, arrow of a dimension, another geometric tolerance, note, or a symbol instance. If there are no offset references, the output argument returns NULL.
    Use the method wfcGTol::SetAttachMakeDimension to set all the attachments options to create a geometric tolerance with Make Dim type of reference. The input argument Attach is specified using the class wfcGTolAttachMakeDimension.
    Use the method wfcGTolAttachMakeDimension::Create to create an attachment for a gtol with Make Dim type of reference.
    Use the methods wfcGTolAttachMakeDimension::GetLocation and wfcGTolAttachMakeDimension::SetLocation to get and set the location of the gtol text in a specified gtol using the class pfcPoint3D.
    Use the methods wfcGTolAttachMakeDimension::GetOrientHint and wfcGTolAttachMakeDimension::SetOrientHint to get and set the orientation of the gtol using the enumerated type pfcDimOrientationHint and one of the valid values are:
    •  pfcORIENTATION_HINT_HORIZONTAL
    •  pfcORIENTATION_HINT_VERTICAL
    •  pfcORIENTATION_HINT_SLANTED
    •  pfcORIENTATION_HINT_ELLIPSE_RADIUS1
    •  pfcORIENTATION_HINT_ELLIPSE_RADIUS2
    •  pfcORIENTATION_HINT_ARC_ANGLE
    •  pfcORIENTATION_HINT_ARC_LENGTH
    •  pfcORIENTATION_HINT_LINE_TO_TANGENT_CURVE_ANGLE
    •  pfcORIENTATION_HINT_RADIAL_DIFF
    Use the methods wfcGTolAttachMakeDimension::GetDimSenses and wfcGTolAttachMakeDimension::SetDimSenses to get and set the information about how the gtol attaches to each attachment point of the model or drawing. The input argument value is specified using the class pfcDimSenses.
    Use the methods wfcGTolAttachMakeDimension::GetDimAttachments and wfcGTolAttachMakeDimension::SetDimAttachments to get and set the points on the model or drawing where the gtol is attached. The input argument value is specified using the class pfcDimensionAttachments.
    Use the methods wfcGTolAttachMakeDimension::GetAnnotationPlane and wfcGTolAttachMakeDimension::SetAnnotationPlane to get and set the annotation plane in a specified gtol using the class wfcAnnotationPlane.