Access to Annotations
 
The structure for the annotations is similar to the structure ProModelitem and is defined as
typedef struct pro_model_item
{
ProType type;
int id;
ProMdl owner;
}ProAnnotation
The value of type for different annotations is as follows:
PRO_NOTE—Specifies a note. Functions specific to notes use the object type ProNote.
PRO_SYMBOL_INSTANCE—Specifies a symbol instance. Functions specific to symbols use the object ProDtlsyminst.
PRO_GTOL—Specifies a geometric tolerance. Functions specific to Gtols use the object ProGtol.
PRO_SURF_FIN—Specifies a surface finish. Functions specific to surface finish use the object ProSurfFinish.
PRO_REF_DIMENSION—Specifies a reference dimension.
PRO_DIMENSION—Specifies a driving or driven dimension. Reference, driven and driving dimension functions may use the object type ProDimension.
PRO_SET_DATUM_TAG—Specifies a set datum tag annotation. Functions specific to set datum tag use the object type ProSetdatumtag.
PRO_CUSTOM_ANNOTATION—Specifies a custom annotation type. Currently, used only for manufacturing template annotations.
Functions Introduced:
ProAnnotationElementGet()
ProAnnotationByViewShow()
ProAnnotationByFeatureShow()
ProAnnotationByComponentShow()
ProCombstateAnnotationErase()
ProDrawingAnnotationErase()
ProAnnotationShow()
ProAnnotationIsShown()
ProAnnotationIsInactive()
ProAnnotationDisplay()
ProAnnotationUndisplay()
ProAnnotationUpdate()
ProFeatureParamsDisplay()
The function ProAnnotationElementGet() returns the annotation element that contains the annotation.
The function ProAnnotationByViewShow() displays the annotation of the specified type in the selected view.
The function ProAnnotationByFeatureShow() displays the annotation of the specified type for the selected feature.
The function ProAnnotationByComponentShow() displays the annotation of the specified type for the selected component.
From Creo Parametric 2.0 M060 onward, you can specify the view in which the annotations for the selected feature and component must be displayed. For the functions ProAnnotationByFeatureShow() and ProAnnotationByComponentShow(), specify the view where the annotations must be displayed. If you pass the input argument view as NULL, the annotations are displayed in all the views.
The following types of annotations are displayed for the functions ProAnnotationByViewShow(), ProAnnotationByFeatureShow(), and ProAnnotationByComponentShow():
PRO_DIMENSION
PRO_REF_DIMENSION
PRO_NOTE
PRO_GTOL
PRO_SURF_FIN
PRO_AXIS
PRO_SET_DATUM_TAG
PRO_SYMBOL_INSTANCE
PRO_DATUM_TARGET
If you want to display an annotation which is dependent on another annotation for its display in the drawing, then the Creo TOOLKIT application must first display the parent annotation. Only after the parent annotation is displayed, the application can display its dependent annotations. For example, if a geometric tolerance is placed on a dimension, then the application must call the function ProAnnotationByViewShow() for PRO_DIMENSION type. The dimension is displayed. To display the geometric tolerance, call the function ProAnnotationByViewShow() for PRO_GTOL. The same logic applies for the functions ProAnnotationByFeatureShow(), and ProAnnotationByComponentShow().
The function ProCombstateAnnotationErase() removes an annotation from the display for the specified combined state.
The function ProDrawingAnnotationErase() removes an annotation from the display for the specified drawing. The annotation is not shown in the specified drawing.
Note:
 
The annotation which was removed from the display using the functions ProCombstateAnnotationErase() and ProDrawingAnnotationErase() will become visible again, only if the function ProAnnotationShow() is called to explicitly display the annotation.
The function ProAnnotationShow() shows the annotation in the current combined state. The annotation will be visible until it is explicitly erased from the combined state . The function also adds the specified annotation to the current combined state, if not added. If the specified annotation has been erased, then the function changes the display status of the erased annotation and makes it visible in the combined state, that is, it unerases the annotation.
This function is also capable of showing an annotation in a drawing view similar to the Creo Parametric command Show and Erase. This function supersedes the functions ProDimensionShow() and ProNoteDisplay().
The function ProAnnotationIsShown() returns the display status of the annotation in the current combined state or drawing.
Note:
 
To get the display status of set datum tags in a drawing, use the function ProDrawingSetDatumTagIsShown().
The function ProAnnotationIsInactive() indicates whether the annotation can be shown or not. An annotation becomes inactive if all the weak references it points to have been lost or consumed.
The functions ProAnnotationDisplay() and ProAnnotationUndisplay() temporarily display and remove an annotation from the display for the specified combined state or drawing. The functions ProAnnotationDisplay() and ProAnnotationUndisplay() should be used together. To edit a shown annotation, it must be first removed temporarily from display using the function ProAnnotationUndisplay() followed by the editing function calls, and finally must be redisplayed using the function ProAnnotationDisplay(), so that the updated annotation is correctly visible to the user.
The function ProAnnotationUpdate() updates the display of an annotation, but does not actually display it. If the annotation is not currently displayed (because it is hidden by layer status or inactive geometry), the text extracted from the annotation with the mode PRODISPMODE_NUMERIC may include callout symbols, instead of the text shown to the user. ProAnnotationUpdate() informs Creo Parametric to update the contents of the annotation in order to cross-reference these callout values. This function supports 3D model notes of the type ProNote and detail notes of the type ProDtlnote.
When you want to force the display of dimensions or parameters, geometric tolerances (gtols), and so on on a single feature, use the function ProFeatureParamsDisplay().
Note:
 
The function ProAnnotationDisplay() supersedes the functions ProDimensionShow() and ProGtolShow().
The function ProAnnotationUndisplay() supersedes the functions ProDimensionErase() and ProGtolErase().
The function ProDimensionDisplayUpdate() is superseded by a combination of ProAnnotationDisplay() and ProAnnotationUndisplay().
這是否有幫助?