Drawings
This section describes the Creo TOOLKIT functions that deal with drawings. Unless otherwise specified, functions that operate on drawings use screen coordinates. See the Core: 3D Geometry chapter to find out more about screen coordinates and how to convert to drawing coordinates (or paper coordinates).
Creating Drawings from Templates
Function Introduced:
Note
The function ProDrawingFromTmpltCreate() will be deprecated in a future release. Use the function ProDrawingFromTemplateCreate() instead.
Use of drawing templates simplifies drawing creation. Such templates contain drawing views with various properties such as:
•  Cross section view
•  Simplified representation
•  Dimensions On or Off
•  Repeat regions (tables based on BOM balloons)
Use the function ProDrawingFromTemplateCreate() to create a drawing from a template and to return a structure containing any errors encountered during drawing creation. This input arguments are:
•  New drawing name
•  Name of existing template to use
•  Solid model to use when creating drawing
Note
In the function ProDrawingFromTemplateCreate(), the object ProMdlnameShortdata supports a file name of 31 characters or less for a model.
•  Drawing output options that specify how you want to view drawings output. Chose any or all from the following list:
  PRODWGCREATE_DISPLAY_DRAWING—display new drawing in a window
  PRODWGCREATE_SHOW_ERROR_DIALOG—display the template error dialog to the user
  PRODWGCREATE_WRITE_ERRORS_TO_FILE—write the errors to a disk file
The function returns an error structure if any errors occur. The error structure contains an array of errors. Each error message may have:
•  Error type
•  Name of view where error occurred
•  Name of drawing sheet where error occurred
•  Name of the invalid or missing object
If the template and/ or the model name of the drawing is an embedded model name, the function ProDrawingFromTemplateCreate() returns the error PRO_TK_INVALID_NAME.
If there are one or more errors while creating the drawing, the function returns the error PRO_TK_DWGCREATE_ERRORS.
Example 1: Drawing Creation from a Template
The sample code in the file UgDrawingFromTmpltCreate.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing shows how to create a drawing from a template.
Diagnosing Drawing Creation Errors
Functions Introduced:
The function ProDwgcreateErrsFree() frees an existing errors table.
Use the function ProDwgcreateErrsCountGet() to return the number of drawing creation errors in the table.
The function ProDwgcreateErrTypeGet() returns the type of a drawing creation error.
Use the function ProDwgcreateErrViewNameGet() returns the name of the template view where the error occurred.
The function ProDwgcreateErrSheetGet() returns the drawing sheet number where the error occurred.
Use the function ProDwgcreateErrViewGet() returns the drawing view where the error occurred. This function is valid for the following error types:
•  PRODWGCRTERR_EXPLODE_DOESNT_EXIST
•  PRODWGCRTERR_MODEL_NOT_EXPLODABLE
•  PRODWGCRTERR_SEC_NOT_PERP
•  PRODWGCRTERR_NO_RPT_REGIONS
•  PRODWGCRTERR_FIRST_REGION_USED
•  PRODWGCRTERR_NOT_PROCESS_ASSEM
•  PRODWGCRTERR_TEMPLATE_USED
•  PRODWGCRTERR_SEC_NOT_PARALLEL
•  PRODWGCRTERR_SIMP_REP_DOESNT_EXIST
ProDwgcreateErrObjNameGet() returns the name of the model invalid. This function is valid for the following error types:
•  PRODWGCRTERR_SAVED_VIEW_DOESNT_EXIST
•  PRODWGCRTERR_X_SEC_DOESNT_EXIST
•  PRODWGCRTERR_EXPLODE_DOESNT_EXIST
•  PRODWGCRTERR_SEC_NOT_PERP
•  PRODWGCRTERR_SEC_NOT_PARALLEL
•  PRODWGCRTERR_SIMP_REP_DOESNT_EXIST
Drawing Setup
Functions Introduced:
You can set all drawing setup file options from a Creo TOOLKIT application. To do this, import a text file in the format of the drawing setup file using the function ProInputFileRead(), with the file type set to PRO_DWG_SETUP_FILE. You can create such a file from Creo TOOLKIT with function ProOutputFileMdlnameWrite(). See the Interface: Data Exchange section for information on these functions.
Use the functions ProDrawingSetupOptionGet() and ProDrawingSetupOptionSet() to return and assign a specific drawing setup file option.
Some of the 2D detail options of the drawings are also applicable to 3D models. The detail options are applied to the model in the same way as to the drawings. Further, the detail options for the model and their values are also stored in the model in the same way as in the drawings.
Use the function ProMdlDetailOptionGet() to get the value of the specified detail option for the model. The function ProMdlDetailOptionSet() sets the value for the specified detail option of the model.
Context in Drawing Mode
Functions Introduced:
The functions ProRibbonContextGet() and ProRibbonContextSet() retrieve and set the context for the specified drawing window, respectively.
From Pro/ENGINEER Wildfire 5.0 onwards, you can specify a context for a drawing. A context presents a set of commands relevant to the type of task that you are currently performing on a drawing. The contexts in the Drawing mode are Layout, Table, Annotate, Sketch, AutobuildZ, Legacy Migration, Analysis, and Review.
Note
To set the context to AutobuildZ, you must first set the configuration option autobuildz_enabled to yes.
One of the arguments to the ProRibbonContextGet() and ProRibbonContextSet() functions is context, which is of the type ProRibbonContext. ProRibbonContext is an enumerated type, which takes the following values:
•  PRO_RBNCONTEXT_DWG_NONE
•  PRO_RBNCONTEXT_DWG_LAYOUT
•  PRO_RBNCONTEXT_DWG_TABLE
•  PRO_RBNCONTEXT_DWG_ANNOTATE
•  PRO_RBNCONTEXT_DWG_SKETCH
•  PRO_RBNCONTEXT_DWG_AUTOBUILDZ
•  PRO_RBNCONTEXT_DWG_REVIEW
•  PRO_RBNCONTEXT_DWG_PUBLISH
Note
If you set context to PRO_RBNCONTEXT_DWG_NONE, all actions for the selected object are available in all contexts, except the contexts in which selection is not allowed. For example, the publish context.
Access Drawing Location in Grid
Function Introduced:
Use the function ProDrawingPosToLocgrid() to find the grid coordinates of a location in the specified drawing. The function specifies the position of a point, expressed in screen coordinates. ProDrawingPosToLocgrid() returns strings representing the row and column containing the point.
Drawing Tree
Pro/ENGINEER Wildfire 5.0 onward, you can view a hierarchical representation of drawing items in an active drawing sheet. This representation is called a Drawing Tree. A drawing tree facilitates selection and availability of drawing operations for the represented drawing items. For more information, see the Creo Parametric Help. Use the following functions to refresh, expand, and collapse the drawing tree:
Functions Introduced:
Use the function ProDrawingtreeRefresh() to rebuild the drawing tree in the Creo Parametric window that contains the drawing. You can use this function after adding a single drawing item or multiple drawing items to a drawing.
Use the function ProDrawingtreeExpand() to expand the drawing tree in the Creo Parametric window and make all drawing sheets and drawing items in the active drawing sheet visible.
Use the function ProDrawingtreeCollapse() to collapse all nodes of the drawing tree in the Creo Parametric window and make its child nodes invisible.
The input arguments to these functions are:
•  drawing—Handle to the drawing that contains the drawing tree.
•  window_id —ID of the Creo Parametric window in which you want to refresh, expand, or collapse the drawing tree.
Note
Use PRO_VALUE_UNUSED to refresh, expand, or collapse the drawing tree in the active window.
Example 2: Performing Operations on a Drawing Tree
The sample code in the file UgDrwTree.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_dwg shows how to expand, collapse, and refresh the drawing tree in the selected drawing.
Merge Drawings
Function Introduced:
Use the function ProDrawingMerge() to merge two drawings.
Drawing Sheets
Functions Introduced:
Drawing sheets are identified in Creo TOOLKIT by the same sheet numbers the Creo Parametric user sees.
The function ProDrawingSheetNameGet() retrieves the name of the specified drawing sheet.
Use the function ProDrawingSheetNameSet() to set the name of the specified drawing sheet. The input arguments are:
•  drawing—Handle to the ProDrawing object.
•  sheet—Sheet number.
•  sheet_name—Name of the sheet. If this argument is passed as NULL, the default sheet name is used.
The function ProDrawingSheetsCount() outputs the current number of sheets in the specified drawing.
The function ProDrawingSheetTrfGet() provides the matrix that transforms from screen to drawing units or vice versa. (See the Core: Coordinate Systems and Transformations chapter for more details on transformations.)
The function ProDrawingSheetSizeGet() returns the size of the sheet used for the drawing. If the sheet is a standard paper size, this will be returned, along with the width and height of the sheet measured in the sheet units.
The function ProDrawingSheetOrientationGet() returns the orientation of the drawing sheet. The orientation can be either portrait or landscape.
The function ProDrawingSheetUnitsGet() retrieves the name of the length units used for measuring the drawing sheet.
The function ProDrawingCurrentSheetGet() returns the sheet number of the currently selected sheet in the specified drawing. It returns a positive integer for the retrieved sheet number and a zero for an invalid input argument.
The function ProDrawingCurrentSheetSet() sets the sheet number for the currently selected sheet in the specified drawing. One of the input arguments to this function is an integer, current_sheet.
The function ProDrawingSheetCreate() adds a sheet to a drawing model of type Notebook, Format, Drawing, Diagram, or Report. The output argument to this function is an integer, new_sheet. If the drawing sheet is successfully created, new_sheet takes the value of the sheet number for the newly created drawing sheet. Otherwise it takes the value, -1.
The function ProDrawingSheetDelete() deletes a sheet from a drawing model of type Notebook, Format, Drawing, Diagram, or Report. You need to enter the type of the drawing model and the sheet number of the sheet to be deleted as input arguments.
The function ProDrawingSheetCopy() creates a copy of a specified drawing sheet. The input arguments to this function are:
•  drawing—The drawing model handle. Set it to NULL to copy a sheet from the current drawing.
•  sheet_to_copy—The sheet number of the sheet to be copied. Set it to a value less than 1 to create a copy of the currently selected sheet.
The output argument to this function is:
•  sheet_copy (optional)—The sheet number of the newly created sheet. Set it to NULL, if you do not want the new sheet number.
The function ProDrawingSheetsReorder() assigns a new sheet number to a specified sheet, and renumbers the remaining sheets accordingly.
The function ProDrawingSheetFormatIsBlanked() identifies whether the format of a specified drawing sheet is blank. In case of the current sheet, set the input arguments drawing and sheet to NULL and to a value less than 1, respectively.
The function ProDrawingFormatGet() returns the name of the drawing format that was used for the specified sheet. ProDrawingFormatAdd() adds or replaces a specified format into a specified drawing sheet.
The function ProDrawingSheetFormatShow() displays the drawing format for a specified drawing sheet. To display the drawing format of the current sheet, set the input arguments drawing and sheet to NULL and to a value less than 1, respectively.
Use the function ProDrawingSheetFormatHide() to hide the drawing format for a specified drawing sheet.
The function ProDrawingSheetFormatIsShown() identifies if the drawing format for a specified drawing sheet is shown. It returns PRO_B_TRUE if the drawing format is shown and returns PRO_B_FALSE if the drawing format is not shown.
The function ProDrawingSheetFromFormatGet() retrieves the sheet number of the drawing format for a specified drawing and sheet number within the drawing.
The function ProDrawingToleranceStandardGet() returns the tolerance standard that is assigned to the specified drawing. Use the function ProDrawingToleranceStandardSet() to set the tolerance standard for a drawing.
Use the function ProDrawingToleranceStandardVersionSet() to set the version for the assigned tolerance standard for the specified drawing.
Note
In the Creo Parametric user interface, this operation requests to regenerate the drawing sheet. The function ProDrawingToleranceStandardVersionSet() does not perform the regeneration itself.
Use the function ProDrawingToleranceStandardVersionGet() to get the version for the assigned tolerance standard for the specified drawing.
Use the function ProDrawingToleranceStandardUpdate() to update the drawing to the most current version of its tolerance standard. The function does not regenerate the drawing sheet.
The function ProDwgSheetRegenerate() regenerates a specified drawing sheet.
Example 3: Listing Drawing Sheets
The sample code in the file UgDrawingFromTmpltCreate.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing shows how to list the sheets in the current drawing.
Example 4: Creating a Copy of the Current Drawing Sheet
The sample code in the file UgSheetCopy.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_dwg shows how to Add a drawing sheet to the current drawing-type object.
Drawing Format Files
The format of a drawing refers to the boundary lines, referencing marks and graphic elements that appear on every sheet before any drawing elements are shown or added. These usually include items such as tables for the company name, detailers name, revision number and date. In a Creo Parametric drawing, you can associate a format file (.frm) with the drawing. This file carries all the format graphical information, and it can also carry some optional default attributes like text size and draft scale. The functions described in this section allow you to get and set the size of the drawing format.
Functions Introduced:
The function ProDrawingFormatSizeSet() sets the size of the drawing format in the specified drawing. You can add a standard or customize size format in the drawing. The input arguments are:
•  drawing—Specifies the name of the drawing.
•  drawing_sheet—Specifies the number of the drawing sheet where the drawing format must be set.
•  size—Specifies the size of the drawing using the enumerated data type ProPlotPaperSize.
•  width—Specifies the width of the drawing in inches, when size is set to VARIABLE_SIZE_PLOT.
It specifies the width of the drawing in millimeters, when size is set to VARIABLE_SIZE_IN_MM_PLOT.
Note
This argument is ignored for all the other sizes of the drawing except VARIABLE_SIZE_PLOT and VARIABLE_SIZE_IN_MM_PLOT. In such cases specify the argument as PRO_VALUE_UNUSED.
•  height—Specifies the height of the drawing in inches, when the size is set to VARIABLE_SIZE_PLOT.
It specifies the width of the drawing in millimeters, when the size is set to VARIABLE_SIZE_IN_MM_PLOT.
Note
This argument is ignored for all the other sizes of the drawing except VARIABLE_SIZE_PLOT and VARIABLE_SIZE_IN_MM_PLOT. In such cases specify the argument as PRO_VALUE_UNUSED.
Use the function ProDrawingFormatSizeGet() to get the size of the drawing format in the specified drawing. The function returns the size of the drawing, and the width and height of the drawing in inches.
Drawing Views and Models
Drawing views are identified by the OHandle ProView. This is the same object handle used to reference 3D model views, accessed by the functions in ProView.h, but there are no cases where the same object can be accessed by both types of function. The general rule is that functions for 3D views are in ProView.h, and start with ProView; functions to manipulate drawing views are in ProDrawing.h and therefore always start with ProDrawing.
Each drawing view has a solid attached to it. The same solid can appear in more than one view. Some solids may be attached to the drawing, but not appear in any view, if the Creo Parametric user has deleted all views of it without also removing the solid itself from the drawing.
Listing Drawing Views
Functions Introduced:
ProDrawingViewsCollect() outputs an array of ProView handles to all the views in a drawing. ProDrawingViewVisit() is an alternative way to find the views, and conforms to the usual form of visit functions. ProDrawingViewSheetGet() outputs the number of the sheet in which a specified view appears.
The function ProDrawingErasedviewSheetGet() outputs the number of the sheet, which contained the view that was erased. If the sheet that contained the erased view is deleted, the sheet ID is returned as PRO_VALUE_UNUSED.
The function ProDrawingViewOutlineGet() outputs the position of the view in the sheet.
The function ProDrawingViewTypeGet() returns the type of a specified drawing view. A drawing view can be of the following types:
•  PRO_VIEW_GENERAL—Specifies a general drawing view.
•  PRO_VIEW_PROJECTION—Specifies a projected drawing view.
•  PRO_VIEW_AUXILIARY—Specifies an auxiliary drawing view.
•  PRO_VIEW_DETAIL—Specifies a detailed drawing view.
•  PRO_VIEW_REVOLVE—Specifies a revolved drawing view.
•  PRO_VIEW_COPY_AND_ALIGN—Specifies a copy and align drawing view.
•  PRO_VIEW_OF_FLAT_TYPE—Specifies a flat type drawing view.
The function ProDrawingViewIdGet() retrieves the ID of the drawing view specified by the drawing and the drawing view handles.
The function ProDrawingViewInit() retrieves the drawing view handle based on the specified drawing handle and the view ID.
The function ProDrawingViewonlyOpen() opens a drawing in the view only mode.
The function ProDrawingViewParentGet() returns the parent view of a specified drawing view. The function ProDrawingViewChildrenGet() returns the child views of a drawing view and the total number of children.
ProDrawingViewOriginGet() returns the location of the origin in terms of the ProPoint3d object and the selection reference in terms of the ProSelection object for a specified drawing view.
ProDrawingViewAlignmentGet() returns the alignment of a drawing view with respect to another view. It returns the alignment style of the drawing view that can be either horizontal or vertical, the reference view to which the view is aligned, and the alignment references of both the aligned and reference views.
ProDrawingViewScaleIsUserdefined() returns a boolean value depending on whether the drawing has a user-assigned scale or not.
ProDrawingViewScaleGet() returns the scale factor applied, even if the view is not a scaled view. ProDrawingScaleGet() returns the overall drawing scale that is applied to all unscaled views.
The function ProDrawingViewPerspectiveScaleGet() returns the perspective scale applied to a drawing view. This scale option is available only for general views. The function returns the following output arguments:
•  eye_dist—Specifies the eye-point distance from model space.
•  view_dia—Specifies the view diameter in paper units such as mm.
The function ProDrawingViewFlagGet() identifies if the projection arrow flag has been set for a projected or detailed drawing view.
ProDrawingViewDisplayGet() outputs the ProDrawingViewDisplay structure that describes the display status of the drawing view. The fields in the structure, all either enums or booleans, are listed below:
•  style—Whether wireframe, hidden line, or shaded.
•  quilt_hlr—Whether hidden-line-removal is applied to quilts.
•  tangent_edge_display—Style of line used for tangent edges.
•  cable_display—Whether cables are shown by centerline, as thick, or using the current default.
•  concept_model—Whether the skeleton is displayed.
•  weld_xsec—Whether welds are included in the cross-section.
ProDrawingViewColorSourceGet() returns the color source of the drawing view representation. The color source can be of the following types:
•  PRO_VIEW_MODEL_COLOR—Specifies that the drawing colors are determined by the model settings.
•  PRO_VIEW_DRAWING_COLOR—Specifies that the drawing colors are determined by the drawings settings.
ProDrawingViewSolidGet() provides the handle to the solid that is being displayed in the drawing view. ProDrawingViewTransformGet() returns the matrix that describes the transform between 3D solid coordinates and 2D screen coordinates for a specified view.
ProDrawingViewNameGet() returns the name of a specified view in the drawing.
ProDrawingViewZclippingGet() returns the reference of the Z-clipping on the drawing view. The reference can be an edge, datum, or point on the surface that is parallel to the view. Geometry contained in the Z-clipping plane and in front of the plane appears, but geometry behind the plane does not appear. The system clips geometry that intersects the plane.
The function ProDrawingViewDatumdisplayGet() determines if a solid model datum has been explicitly shown in a particular drawing view.
The function ProDrawingViewPipingdisplayGet() returns the piping display option for a drawing view.
The function ProDrawingViewIsErased() identifies if the drawing view is erased or not.
The function ProDrawingViewNeedsRegen() identifies whether the drawing or the specified drawing view needs to be regenerated.
The function ProDrawingViewXhatchDependentGet() checks if the section hatching is dependent on the parent view. The input arguments are listed below:
•  drawing—Specify the drawing using the ProDrawing handle.
•  view—Specify the view using the ProView handle.
The output argument is_dep returns PRO_B_TRUE if dependent on the parent view using the ProBoolean object.
Example 5: Listing the Views in a Drawing
The sample code in the file UgDrawingViews.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing shows a command that creates an information window reporting information about all the views in a drawing.
Modifying Views
Functions Introduced:
The function ProDrawingViewMove() moves the specified drawing view and its child views by a vector to a new position in screen coordinates. This function performs the same operation as the Creo Parametric command Sketch  Edit  Move Special.
The function ProDrawingViewDelete() deletes the drawing view and any of its child views, or fails if the view has any children.
The function ProDrawingViewErase() erases a specified drawing view.
The function ProDrawingViewResume() resumes the specified drawing view.
ProDrawingViewOriginSet() assigns the location of the origin in terms of the ProPoint3d object and the selection reference in terms of the ProSelection object for a specified drawing view.
The function ProDrawingViewAlignmentSet() assigns the alignment of a drawing view with respect to another view. This function assigns the following input arguments related to alignment:
•  view_reference—Specifies the reference view to which the drawing view is aligned.
•  align_style—Specifies the alignment style in terms of the enumerated type ProDrawingViewAlignStyle. The alignment style can be either horizontal or vertical. In case of horizontal alignment, the drawing view and the view it is aligned to lie on the same horizontal line. In case of vertical alignment, the drawing view and the view it is aligned to lie on the same vertical line.
•  align_ref_1—Specifies the alignment reference of the referenced view. If this is set to NULL, the reference view is aligned according to its view origin.
•  align_ref_2—Specifies the alignment reference of the aligned view. If this is set to NULL, the aligned view is aligned according to its view origin.
The function ProDrawingViewScaleSet() modifies the scale of a scaled view. If you want to set the drawing view to use the default scale, use PRO_DRAWING_SCALE_DEFAULT. The function ProDrawingScaleSet() modifies the overall drawing scale that is applied to all unscaled views.
The function ProDrawingViewProjectionSet() assigns the specified drawing view as a projection.
The function ProDrawingViewFlagSet() sets the projection arrow flag to TRUE for a projected or detailed drawing view.
The function ProDrawingViewDisplaySet() assigns the fields in the ProDrawingViewDisplay structure that describe the display status of the drawing view. This function does not repaint the drawing view, use the function ProWindowRepaint() to repaint the view.
Note
In order to modify the concept_model field in the ProDrawingViewDisplay structure, you require an Assembly license.
The function ProDrawingViewNameSet() assigns a name to a specified drawing view.
Note
The configuration option allow_duplicate_view_names enables you to set duplicate names for drawing views. When the configuration option is set to no, the function returns an error if another drawing view in the specified drawing exists with the same name.
The function ProDrawingViewZclippingSet() sets the Z-clipping on the drawing view to reference a given edge, datum, or point on the surface that is parallel to the view. Geometry contained in the Z-clipping plane and in front of the plane appears, but geometry behind the plane does not appear. The system clips geometry that intersects the plane.
The function ProDrawingViewPipingdisplaySet() assigns the piping display option for a drawing view. The piping display options are as follows:
•  PRO_PIPINGDISP_DEFAULT—Displays the default appearance of pipes for the piping assembly.
•  PRO_PIPINGDISP_CENTERLINE—Displays pipes as centerlines without insulation.
•  PRO_PIPINGDISP_THICK_PIPES—Displays thick pipes without insulation.
•  PRO_PIPINGDISP_THICK_PIPES_AND_INSULATION—Displays thick pipes and insulation.
The function ProDrawingViewRegenerate() regenerates the drawing view specified by the ProView view handle.
The function ProDwgViewRegenerate() erases the displayed view of the current object, regenerates the view from the current drawing, then redisplays the view.
The function ProDrawingViewXhatchDependentSet() sets the section hatching dependency on the parent view. The input arguments are:
•  drawing—Specify the drawing using the ProDrawing handle.
•  view—Specify the view using the ProView handle.
The output argument is dependent—Pass the PRO_B_TRUE value to make it dependent or pass the PRO_B_FALSE value to make it independent from the parent view using the ProBoolean object.
Creating Views
Function Introduced:
A general view is usually the first view placed on a drawing sheet. It is the most versatile view, that is, it can be scaled or rotated to any setting.
A projected view is an orthographic projection of another view’s geometry along a horizontal or vertical direction.
The above functions create general and projected drawing views.
Example 6: Creating General and Projected Drawing Views
The sample code in the file UgDrawingViews.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing adds a new sheet to a drawing, and creates one general and two projected views of a selected model.
Background Views
Functions Introduced:
Views can be assigned not only to the solid views that the user creates, but also to each sheet. The view assigned to a drawing sheet is called a background view. Function ProDrawingViewIsBackground() determines whether the specified view is a background view.
If you use ProSelect() for an item in a drawing that is not inside a solid view, such as a detail item, the ProView view handle output by ProSelectionViewGet() is the background view.
Note
These functions supersede the functions ProDrawingViewIsOverlay() and ProDrawingOverlayviewGet(), which previously served the same purpose.
Detailed Views
Functions Introduced:
A detailed view is a small portion of a model shown enlarged in another view.
The function ProDrawingViewDetailCreate() creates a detailed view given the reference point on the parent view, the spline curve data, and location of the new view. A note with the detailed view name and the spline curve border are included in the parent view for the created detailed view.
The functions ProDrawingViewDetailReferenceGet() and ProDrawingViewDetailReferenceSet() return and assign, respectively, the reference point on the parent view for a specified detailed view.
The functions ProDrawingViewDetailCurvedataGet()and ProDrawingViewDetailCurvedataSet() retrieve and assign, respectively, the spline curve data in terms of the ProCurvedata handle for a specified detailed view. The output argument, curve_data specifies the following:
•  The X, Y, and Z coordinate directions match the world space.
•  The coordinate point (0,0,0) maps to the reference point.
•  The scaling unit is of one inch relative to the top model of the view. If two points in the spline are at a distance of '1' from each other, then in the actual view, the points will be one inch distant from each other, if measured in the scale of the top model. For example, if one of the points in the spline definition has coordinates (0.5, 0.0, 0.0), then the position of that point is not half an inch to the right of the reference point on the paper. Instead, when projected as a point in the space of the top model of the view, it is half an inch to the right of the reference point when measured in the space of that model.
Use the function ProCurvedataAlloc() to allocate memory for the curve data structure.
The function ProDrawingViewDetailBoundaryGet() retrieves the type of spline curve used to define the boundary of the detailed view and also identifies whether the boundary is displayed on the parent view.
The function ProDrawingViewDetailBoundarySet() assigns the boundary type for a detailed view in terms of the enumerated type ProViewDetailBoundaryType. The types of boundaries are:
•  PRO_DETAIL_BOUNDARY_CIRCLE—Draws a circle in the parent view.
•  PRO_DETAIL_BOUNDARY_ELLIPSE—Draws an ellipse in the parent view.
•  PRO_DETAIL_BOUNDARY_HORZ_VER_ELLIPSE—Draws an ellipse with a horizontal or vertical major axis.
•  PRO_DETAIL_BOUNDARY_SPLINE—Displays the spline boundary drawn by the user in the parent view.
•  PRO_DETAIL_BOUNDARY_ASME_CIRCLE—Displays an ASME standard-compliant circle as an arc with arrows and the detailed view name.
This function also sets the ProBoolean argument show to display the boundary of the detailed view in the parent view.
Auxiliary Views
Functions Introduced:
An auxiliary view is a type of projected view that projects at right angles to a selected surface or axis. The selected surface or axis in the parent view must be perpendicular to the plane of the screen.
The function ProDrawingViewAuxiliaryCreate() creates an auxiliary view given the selection reference and the point location.
The function ProDrawingViewAuxiliarySet() sets a specified drawing view as the auxiliary view.
The function ProDrawingViewAuxiliaryInfoGet() retrieves information such as the selection reference in terms of the ProSelection object and the point location in terms of the ProPoint3d object for a specified auxiliary view.
Revolved Views
Functions Introduced:
A revolved view is a cross section of a drawing view revolved 90 degrees around a cutting plane projection.
The function ProDrawingViewRevolveCreate() creates a revolved view given a cross section, the selection reference, and the point location.
The function ProDrawingViewRevolveInfoGet() retrieves information such as the cross section in terms of the ProXsec object, the selection reference in terms of the ProSelection object, and the point location in terms of the ProPoint3d object for a specified revolved view.
Draft Views
Functions Introduced:
Draft views are created from the Sketch tab in a drawing using the selected draft entities. The draft entities added to the view are automatically related to the view. Any pre-existing relationship will be removed, and the entity will be related to the draft view.
The function ProDrawingDraftViewsCollect() collects all draft views in the specified drawing. The output argument views is the list of draft views. The function ProDrawingDraftViewsCollect() allocates memory to the ProView handle. To free the memory call the function ProArrayFree().
The function ProDrawingViewIsDraft() determines whether the specified view is a draft view. The input arguments follow:
•  drawing—Specify the drawing in which the draft view exists.
•  view —Specify the view using the ProView handle.
If the specified view is a draft view, the function returns a ProBoolean output argument with the value PRO_B_TRUE. Otherwise, the function returns PRO_B_FALSE.
The function ProDrawingDraftViewCreate() creates a draft view in the specified drawing sheet. The input arguments follow:
•  drawing—Specify the drawing in which draft view is to be created.
•  entities—Specify at least one daft entity using the ProDtlentity object. Entities might or might not be related to any view.
The function outputs a pointer to the ProView handle.
View Orientation
Functions Introduced:
The orientation type for a drawing view is given by the enumerated type ProDrawingViewOrientationType. The view orientation can be of the following types:
•  PRO_VIEW_ORIENT_NAME—The drawing view is oriented using saved views from the model.
•  PRO_VIEW_ORIENT_GEOM_REF—The drawing view is oriented using geometric references from the model.
•  PRO_VIEW_ORIENT_ANGLE—The drawing view is oriented using angles of selected references or custom angles.
Note
The drawing view must be displayed before applying any orientation to it.
The function ProDrawingViewOrientationFromNameSet() assigns the orientation of a specified drawing view according to the following input arguments:
•  mdl_view_name—Specifies the name of the saved view in the model.
•  orientation_name—Specifies the name of the user-defined orientation for the saved view.
•  x_angle—Specifies the X angle in degrees for the user-defined orientation.
•  y_angle—Specifies the Y angle in degrees for the user-defined orientation.
The function ProDrawingViewOrientationFromReferenceSet() assigns the orientation of a specified drawing view according to the following input arguments:
•  ref_name_1—Specifies the name of the first geometric reference.
•  ref_sel_1—Specifies the first reference selection on the model in terms of the ProSelection object.
•  ref_name_2—Specifies the name of the second geometric reference.
•  ref_sel_2—Specifies the second reference selection on the model in terms of the ProSelection object.
The function ProDrawingViewOrientationFromAngleSet() assigns the orientation of a specified drawing view according to the following input arguments:
•  sel—Specifies the reference selection in terms of the ProSelection object. It can be an axis or NULL for other type.
•  angle—Specifies the angle in degrees with the selected reference.
•  rot_ref_name—Specifies the name of the rotational angle.
•  index—Specifies the index of the angle setting.
Visible Areas of Views
Functions Introduced:
As you detail your model, certain portions of the model may be more relevant than others or may be clearer if displayed from a different view point.
The function ProDrawingViewVisibleareaTypeGet() retrieves the type of visible area for a specified drawing view in terms of the enumerated type ProDrawingViewVisibleareaType. The visible area can be of the following types:
•  PRO_VIEW_FULL_AREA—The complete drawing view is retained as the visible area.
•  PRO_VIEW_HALF_AREA—A portion of the model from the view on one side of a cutting plane is removed.
•  PRO_VIEW_PARTIAL_AREA—A portion of the model in a view within a closed boundary is displayed.
•  PRO_VIEW_BROKEN_AREA—A portion of the model view from between two or more selected points is removed, and the gap between the remaining two portions is closed within a specified distance.
The function ProDrawingViewFullVisibleAreaSet() retains the specified drawing view as the full visible area.
The function ProDrawingViewHalfVisibleAreaGet()
The function ProDrawingViewHalfVisibleAreaSet()
•  plane_ref—Specifies the selection reference in terms of the ProSelection object that divides the drawing view. The cutting plane can be a planar surface or a datum, but it must be perpendicular to the screen in the new view.
•  keep_side—Specifies the half side of the model that is to be retained.
•  line_standardProDrawingLineStandardType
  PRO_HVL_NONE—Specifies no line
  PRO_HVL_SOLID—Specifies a solid line.
  PRO_HVL_SYMMETRY—Specifies a symmetry line.
  PRO_HVL_SYMMETRY_ISO—Specifies an ISO-standard symmetry line.
  PRO_HVL_SYMMETRY_ASME—Specifies an ASME-standard symmetry line
The function ProDrawingViewPartialVisibleAreaGet() gets the partial visible area of a drawing view.
The function ProDrawingViewPartialVisibleAreaSet() assigns the following arguments to define the partial visible area for a specified drawing view:
•  ref_pointProSelection
•  curve_dataProCurvedata
•  show_boundaryProBooleanPRO_B_TRUE
The function ProDrawingViewBrokenVisibleAreaGet() retrieves the broken visible area for a specified drawing view.
The function ProDrawingViewBrokenVisibleAreaSet() assigns the following arguments to define the broken visible area for a specified drawing view:
•  dir—Specifies the direction of the broken lines that define the broken area to be removed. The direction is given by the enumerated type ProViewBrokenDir and takes the following values:
  PRO_VIEW_BROKEN_DIR_HORIZONTAL—Specifies the horizontal direction.
  PRO_VIEW_BROKEN_DIR_VERTICAL—Specifies the vertical direction.
•  first_sel—Specifies the selection point in terms of the ProSelection object for the first break line.
•  second_sel—Specifies the selection point in terms of the ProSelection object for the second break line.
•  line_style—Specifies the line style for the broken lines in terms of the enumerated type ProViewBrokenLineStyle. It can be one of the following types:
  PRO_VIEW_BROKEN_LINE_STRAIGHT—Specifies a straight broken line.
  PRO_VIEW_BROKEN_LINE_SKETCH—Specifies a random sketch drawn by the user that defines the broken line.
  PRO_VIEW_BROKEN_LINE_S_CURVE_OUTLINE—Specifies a S-curve on the view outline.
  PRO_VIEW_BROKEN_LINE_S_CURVE_GEOMETRY—Specifies a S-curve on geometry.
  PRO_VIEW_BROKEN_LINE_HEART_BEAT_OUTLINE—Specifies a heartbeat type of curve on the view outline.
  PRO_VIEW_BROKEN_LINE_HEART_BEAT_GEOMETRY—Specifies a heartbeat type of curve on the geometry.
•  curve_data—Specifies the spline curve data in terms of the ProCurvedata object when the line_style is of the type PRO_VIEW_BROKEN_LINE_SKETCH.
The function ProDrawingViewBrokenNumberGet() returns the number of breaks defined for the broken visible area. Two broken lines define one break.
Note
A broken visible area can be created only for general and projected view types.
For the functions ProDrawingViewPartialVisibleAreaSet(), ProDrawingView2DSectionGet(), ProDrawingViewBrokenVisibleAreaGet(). ProDrawingViewPartialVisibleAreaGet(), ProDrawingViewDetailCurvedataGet(), and ProDrawingViewDetailCurvedataSet(), the output argument curve_data specifies the following::
•  X, Y, and Z coordinate directions match the X, Y and Z of the world space.
•  The coordinate points (0,0,0) maps to the detail view’s reference point
•  The scaling unit is of one inch relative to the top model of the view.
To map the curve data to world space:
•  Scale the spline by inch to top model unit.
•  Scale the spline by top model unit to world unit, which is the scale of the transform from ProDrawingViewTransformGet() (view_to_drawing = TRUE),
•  Translate the curve to place (0,0) at the reference point.
To map a spline in world space for use here, perform the inverse actions:
•  Translate the spline by the reference point to place that point at (0,0).
•  Scale by world-to-model (inverse of the scale of the view's transformation matrix)
•  Scale by top-model-unit-to-inch.
Sections of a View
Functions Introduced:
The function ProDrawingViewSectionTypeGet() retrieves the section type for a specified drawing view in terms of the enumerated type ProDrawingViewSectionType. A section can be of the following types:
•  PRO_VIEW_NO_SECTION—Specifies no section.
•  PRO_VIEW_TOTAL_SECTION—Specifies the complete drawing view.
•  PRO_VIEW_AREA_SECTION—Specifies a 2D cross section.
•  PRO_VIEW_3D_SECTION—Specifies a 3D cross section.
•  PRO_VIEW_PART_SURF_SECTION—Specifies a section created out of a solid surface or a datum quilt in the model.
A drawing can have many 2D cross sections defined in it. These cross sections are indexed. The first cross section has its index number set to 0. Depending on which 2D cross section you want to work with, specify the index number.
The function ProDrawingView2DSectionGet() retrieves the 2D cross section for a specified drawing view.
The function ProDrawingView2DSectionSet() assigns the following arguments to define the 2D cross section for a drawing view:
•  sec_name—Specifies the name of the 2D cross section.
•  sec_area_type—Specifies the type of section area. The section area is given by the enumerated type ProDrawingViewSectionAreaType and can be of the following types:
  PRO_VIEW_SECTION_AREA_FULL—Sectioning is applied to full drawing view.
  PRO_VIEW_SECTION_AREA_HALF—Sectioning is applied to half drawing view depending upon the inputs for half side.
  PRO_VIEW_SECTION_AREA_LOCAL—Specifies local sectioning.
  PRO_VIEW_SECTION_AREA_UNFOLD—Unfold the drawing view and section it.
  PRO_VIEW_SECTION_AREA_ALIGNED—Sectioning is as per the aligned views.
•  ref_sel—Specifies the selection reference in terms of the ProSelection object.
•  curve_data—Specifies the spline curve data in terms of the ProCurvedata handle.
•  arrow_display_view—Specifies the drawing view, that is, either the parent or child view, where the section arrow is to be displayed.
Note
For a section area of type PRO_VIEW_SECTION_AREA_FULL in the above function, you can pass the input arguments ref_sel, curve_data, and arrow_display_view as NULL.
The function ProDrawingView2DSectionNumberGet() retrieves the number of 2D cross sections defined for a drawing view.
The function ProDrawingView2DSectionFlip() flips the direction of 2D cross section in a drawing view. Specify the index of the 2D cross section that you want to flip.
Use the function ProDrawingView2DSectionFlipGet() returns a boolean value that indicates the direction in which the 2D cross section has been clipped. Depending on the type of cross section, the boolean value indicates different direction of clipping as below:
•  Planar cross section—The boolean value:
  PRO_B_FALSE indicates that the cross section has been clipped in the direction of the positive normal to the cross section plane.
  PRO_B_TRUE indicates that the cross section has been clipped in the opposite direction of the positive normal.
•  Offset cross section—The integer value:
  PRO_B_FALSE indicates that material has been removed from the left of the cross section entities if the viewing direction is from the positive side of the entity plane.
  PRO_B_TRUE indicates that the material has been retained from the left of the cross section entities and rest of the material has been removed.
The function ProDrawingView3DSectionGet() retrieves the 3D cross section for a specified drawing view.
The function ProDrawingView3DSectionSet() assigns the following arguments to define a 3D cross section for a view:
•  sec_name —Specifies the name of the 3D cross section.
•  show_x_hatch—Specifies a ProBoolean value that determines whether X-hatching is displayed in the 3D cross-sectional view. Set this argument to PRO_B_TRUE to display X-hatching.
The function ProDrawingViewSinglepartSectionGet() retrieves the section created out of a solid surface or a datum quilt in the model for a specified drawing view.
The function ProDrawingViewSinglepartSectionSet() assigns the reference selection in terms of the ProSelection object for the solid surface or datum quilt that is used to create the section in the view.
The functions ProDrawingView2DSectionTotalSet() and ProDrawingView2DSectionAreaSet() enable you to set the visibility of model edges in a 2D cross section view of a drawing.
The function ProDrawingView2DSectionTotalSet() sets the visibility of model edges to Total. A total cross section shows not only the cross-sectioned area, but also the edges of the model that become visible when a cross section is made. Here model edges behind the section planes as well as section edges are displayed.
The function ProDrawingView2DSectionAreaSet() sets the visibility of model edges to Area. An area cross section displays only the cross section without the geometry, that is, only section edges are displayed.
View States
Functions Introduced:
The functions ProDrawingViewSimplifiedGet() and ProDrawingViewSimplifiedSet() retrieve and set the simplified representation for a specified drawing view.
The functions ProDrawingViewExplodedGet() and ProDrawingViewExplodedSet() retrieve and set the exploded state for a specified drawing view.
Example 7: Creating Drawing Views and Accessing their Properties
The sample code in the file UgNotesColor.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_dwg creates both general and projection types of drawing views and accesses the view scale, orientation, exploded state, and visible areas of the created drawing views.
Drawing Models
Functions Introduced:
The function ProDrawingSolidsCollect() outputs an array of the solids attached to the drawing, including those not currently displayed in a view. Function ProDrawingSolidsVisit() is a visit function of the usual form which visits the same solids.
The function ProDrawingSolidAdd() adds a new solid to a drawing, but does not display it. (To create a drawing view, refer to the Creating Views section.)
ProDrawingSolidDelete() deletes a solid from a drawing, provided that solid is not currently displayed in a view.
Functions ProDrawingSimprepsCollect(),ProDrawingAsmsimprepAdd(), and ProDrawingAsmsimprepDelete() are the equivalents to the above functions but take a handle to a simplified rep.
The function ProDrawingSolidReplace() replaces a drawing model solid with another solid. The old and new solids must be members of the same family table. The following example code describes this function.
The functions ProDrawingCurrentsolidGet() and ProDrawingCurrentsolidSet() provide access to the current solid model for a given drawing.
Example 8: Replace Drawing Model Solid with a Solid
The sample code in the file UgDrawingSolidReplace.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing shows how to replace a drawing model solid with a solid.
Detail Items
The functions described in this section operate on detail items. Detail items are those drawing items that you create in Creo Parametric in the drawings.
In Creo TOOLKIT, you have the ability to create, delete, and modify detail items, control their display, and examine what detail items are present in the drawing.
There types of detail items available in Creo TOOLKIT are:
•  Draft entities—Contain the graphical items created in Creo Parametric using the options under the Sketch tab, in the Sketching group. Some of the items are as follows:
  Arc
  Ellipse
  Line
  Point
  Polygon
  Spline
•  Notes—Textual annotations created in Creo Parametric using the command Annotate  Note. They can also contain special symbols.
•  Symbol definitions—Named groups of other detail items that the Creo Parametric user can save to disk. You create them in Creo Parametric using the options in the Annotate  Symbol command.
•  Symbol instances—Instances of a symbol.
•  Draft groups—Groups of detail items such as draft entities, notes, symbol instances, and drawing dimensions. You create them in Creo Parametric using the command Sketch  Draft Group.
•  OLE objects—Object Linking and Embedding (OLE) objects embedded in the Creo Parametric drawing file from the Insert Object dialog box that opens when you click Layout  Object.
All detail items are identified by DHandles which are equivalent to ProModelitem, and inherit from ProModelitem. This implies that functions such as ProSelectionModelitemGet(), ProSelectionAlloc(), and ProModelitemInit(), can be used for detail items. The values of the type field for the types of detail item are:
•  PRO_DRAFT_ENTITY—This type is used for draft entities and OLE objects. Special functions exist to distinguish OLE objects from other detail entities.
•  PRO_NOTE
•  PRO_SYMBOL_DEFINITION
•  PRO_SYMBOL_INSTANCE
•  PRO_DRAFT_GROUP
There is generic detail object called ProDtlitem, whose type field can take any of these values, and is used for arguments to functions that can represent any detail item. The following object handles are used in the more specific cases:
•  ProDtlentity
•  ProDtlnote
•  ProDtlsymdef
•  ProDtlsyminst
•  ProDtlgroup
Listing Detail Items
Functions Introduced:
The function ProDrawingDtlentitiesCollect() collects all the detail entities in the specified drawing and sheet. Set the input argument symbol to NULL if you are collecting a detail item in the drawing. If you are collecting a draft entity in a symbol definition, set symbol to specify the owning symbol definition.
Note
The function ProDrawingDtlentitiesCollect() will not collect entities with special symbol definition, such as, datum targets or parametric connector symbols.
The function ProDrawingDtlentityVisit() visits all the draft entities stored in the specified drawing and sheet.
Note
The function ProDrawingDtlentityVisit() will not visit entities with special symbol definition, such as, datum targets or parametric connector symbols.
The function ProDrawingDtlnotesCollect() collects all the notes in the specified drawing. Set the input argument symbol to NULL if you are collecting a note from the drawing. If you are collecting a note from a symbol definition, set symbol to specify the owning symbol definition.
The function ProDrawingDtlnoteVisit() visits the notes in the specified drawing.
The function ProDrawingDtlsymdefsCollect() collects the symbol definitions in the specified drawing.
The function ProDrawingDtlsymdefVisit() visits the symbol definitions in the drawing.
The function ProDrawingDtlsyminstsCollect() collects symbol instances in the specified drawing.
The function ProDrawingDtlsyminstVisit() visits symbol instances in the specified drawing.
The function ProDrawingDtlgroupsCollect() collects groups in the specified drawing.
The function ProDrawingDtlgroupVisit() visits groups in the specified drawing.
The function ProDrawingOLEobjectsVisit() visits the OLE objects embedded in the model. Specify the visit action and visit filter functions.
Displaying Detail Items
Functions Introduced:
Each of the displayable item types has four display functions.
The Show function displays the detail item, such that it is repainted on the next draft regeneration.
The Remove function undraws the detail item permanently, so that it is not redrawn on the next draft regeneration.
The Draw function draws the detail item temporarily, so that it is removed on the next draft regeneration.
The Erase function undraws the detail item temporarily, so that it is redrawn on the next draft regeneration, if it was previously “shown”.
Use the Show function after creating an item, and the Remove function before deleting it. Use the Erase function before modifying an item, and the Draw function afterwards.
Note
These functions require that the drawing must be the currently displayed model. To create or modify detail items in a model that is not currently displayed, use the attributes in the data structures related to Display. For example use ProDtlnotedataDisplayedSet() to set the item to be saved with the displayed status turned on, so that the next retrieval of the model will display the item.
Creating, Modifying and Reading Detail Items
Functions Introduced:
For each of the five detail item types there is an opaque data structure which describes the contents of the detail item. You build the appropriate data structure first, using functions provided for that purpose, and then pass it as input to the appropriate Create() function. The *DataGet() functions output a filled structure describing an existing detail item. The data structures are built and unpacked by their own functions for that purpose described in the following sections.
The function ProDtlentityDataGet() returns a structure that contains information about the specified detail item, in a drawing or in a symbol definition.
Note
The functions ProDtlentityDataGet(), ProDtlentityCreate(), ProDtlentityDelete(), and ProDtlentityModify cannot access symbol definitions for special symbols, such as, datum targets or parametric connector symbols. For such symbols, the functions return the error PRO_TK_GENERAL_ERROR.
The functions ProDtlnoteDataGet() and ProDtlsyminstDataGet() have an argument for the display mode. Both notes and symbols may contain parameterized text, and the display mode specifies whether the data structure output by the *DataGet() function must contain the text before substitution of the parameters (SYMBOLIC mode), or after the displayed text (NUMERIC mode). If using ProDtlnoteDataGet() as a first step in note modification, always set mode to SYMBOLIC or the modification removes the parameterization. Refer to section Detail Note Line Data for more information.
Some data structures contain arrays of, or pointers to, deeper structures which have their own manipulation functions, also described in later sections. Lower level data structures should be built before the upper level ones when creating detail items. The data structures and their member structures are listed below.
•  ProDtlentitydata—A draft entity
•  ProCurvedata—The 2D geometry of the entity (described in the Core: 3D Geometry section)
•  ProDtlnotedata—A detail note
•  ProDtlnoteline—A line of text in a note
•  ProDtlnotetext—A segment of text in a line that may have it's own cosmetic properties, such as font, height, and so on
•  ProDtlattach—One structure for the attachment of the note itself, and one per leader on the note
•  ProDtlsymdefdata—A symbol definition
•  ProDtlsymdefattach—The types of attachment support for an instance of this symbol
•  ProDtlsyminstdata—A symbol instance
•  ProDtlvartext—A variable text substitution
The sequence of calls to create a draft entity containing, for example, a line would be:
1. ProDtlentitydataAlloc()—Allocate the entity data (see the section on Draft Entity Data).
2. ProCurvedataAlloc()—Allocate memory for a curve structure
3. ProLinedataInit()—Set the curve structure to describe the required line by initializing a line data structure.
4. ProDtlentitydataCurveSet()—Add the curve data to the entity data (see the section on Draft Entity Data).
5. ProDtlentityCreate()—Create the entity (see the section on Creating, Modifying and Reading Detail Items).
Note
You must set the drawing view before attempting to create a detail entity, unless you are creating entities in a symbol definition. The view can be a traditional drawing view obtained through ProDrawingViewsCollect(), or the drawing sheet background view obtained from ProDrawingBackgroundViewGet().
The other detail items follow the same principles, although for symbol definitions there are added complexities; these are explained inCreating a Symbol Definition.
The function ProDtlentityIsOLEObject() identifies if the specified detail entity is actually an OLE object. For more information on OLE objects refer to Accessing OLE Objects.
Each entity item has its own Delete() function which removes it permanently from the Creo Parametric drawing.
Each entity item also has its own Modify() function which passes a new Data structure.
Use the function ProDtlnoteErase() to temporarily undraw the note (see the section on Displaying Detail Items).
The function ProDtlnoteDataGet() returns the data for the note.
The function ProDtlnoteModify() uses the modified data to modify the note itself.
The function ProDtlnoteDraw() redraws the note (see the section on Displaying Detail Items).
The function ProDtlnoteLineEnvelopeGet() determines the screen coordinates of the envelope around a detail note. This envelope is defined by four points. See figure Detail Note Envelope Point Order for how point order is determined.
Detail Note Envelope Point Order
Image
The function ProDtlsymdefToModelCopy() copies a specified symbol definition from one model to another.
The function ProDtlsymdefDelete() deletes a symbol definition. This function returns the error PRO_TK_GENERAL_ERROR when the deletion of a symbol definition from a part fails.
The function ProDtlsymdefModify() modifies a symbol definition. The input arguments are listed below:
•  symdef—Specifies the symbol definition.
•  data—Specifies the symbol definition data.
Draft Entity Data
Functions Introduced:
The opaque data structure which describes the contents of a draft entity is called ProDtlentitydata.
The only lower-level opaque data structure contained by ProEntitydata is ProCurvedata which is also used for other 2D and 3D geometry, especially Import Features, and is described elsewhere.
The functions ProDtlentitydataAlloc() and ProDtlentitydataFree() allocate and free an opaque entity data structure.
Functions ProDtlentitydataCurveGet() and ProDtlentitydataCurveSet() get and set the geometry of the entity in the form of a ProCurvdata object.
ProDtlentitydataColorGet() and ProDtlentitydataColorSet() get and set the color of the draft entity. The visible data structure ProColor, declared in ProDtlitem.h, can specify the color in three ways:
•  By color index, that is, by choosing one of colors predefined in Creo Parametric, represented by the values of ProColortype in ProToolkit.h
•  By choosing the default color for this type of detail item. (For entities, the default is PRO_COLOR_DRAWING and for notes the default is PRO_COLOR_LETTER.)
•  By specifying the three RGB color values.
If do you do not call ProDtlentitydataColorSet() when creating a new entity, the color will be set to be the default color for draft entities.
ProDtlentitydataFontGet() and ProDtlentitydataFontSet() get and set the line style font which determines the line style used to display the entity. The values are those which appear in the Line Font selector in the Modify Line Style dialog in Creo Parametric. If you do not call ProDtlentitydataFontSet() when creating an entity, the font will be SOLIDFONT.
ProDtlentitydataWidthGet() and ProDtlentitydataWidthSet() get and set the line width of the draft entity. The value -1.0 indicates that the entity should have the default width for entities currently set for the drawing. If you do not call ProDtlentitydataWidthSet() when creating a new entity, the width is -1.0.
ProDtlentitydataViewGet() and ProDtlentitydataViewSet() get and set the drawing view to which the entity will be attached. If an entity is attached to a view, it moves whenever the Creo Parametric user moves that view. Entities not attached to a model view must be assigned to the drawing sheet background view instead.
ProDtlentitydataIsConstruction() and ProDtlentitydataConstructionSet() get and set the flag that controls whether the entity is created normal or as a construction entity.
The function ProDtlentitydataIsPeriodic() checks if the draft identity is marked as periodic. The output argument is_periodic is a Boolean. The value PRO_B_TRUE indicates that the draft entity is periodic.
The function ProDtlentitydataPeriodicSet() marks the draft entity to be periodic. The input arguments are as follows:
•  data—The draft entity data.
•  periodic—Specify the value PRO_B_TRUE if the draft entity is to be periodic.
Use the function ProDrawingDraftToDraftent() to convert a selection of type draft to draft entity in the specified drawing. The input arguments follow:
•  p_draw—Specifies the drawing that owns the draft entity.
•  p_sel_draft—A ProSelection object that represents the selection of type as draft.
The output argument r_p_sel_draft_ent returns the handle to the converted selection using the ProSelection object. The converted selection is managed by the function that calls the function ProDrawingDraftToDraftent().
Example 9: Create a Draft Line with Predefined Color
The sample code in the file UgDtlentityExamples.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing shows a utility that creates a draft line in one of the colors predefined in Creo Parametric.
Accessing OLE Objects
An object linking and embedding (OLE) object is an external file, such as a document, graphics file, or video file that is created using an external application and which can be inserted into another application, such as Creo Parametric. You can create and insert supported OLE objects into a two-dimensional Creo Parametric file, such as a drawing, report, format file, Notebook, or diagram. The functions described in this section enable you to identify and access OLE objects embedded in drawings.
Function Description
The function ProDrawingOLEobjectSheetGet() returns the sheet number for the OLE object.
The function ProDrawingOLEobjectOutlineGet() returns the extent of the OLE object embedded in the drawing.
The function ProDrawingOLEobjectApplicationtypeGet() returns the type of the OLE object as a string, for example, Microsoft Word Document.
The function ProDrawingOLEobjectPathGet() returns the path to the external file for each OLE object, if it is linked to an external file.
Detail Note Text Data
Functions Introduced:
Each line of a drawing note may contain text in several different fonts, heights, and so on. So each line is described in terms of an array of text items, whose contents are described by the data structure ProDtlnotetext.
ProDtlnotetextAlloc() and ProDtlnotetextFree() allocate and free a ProDtlnotetext data structure.
ProTextStyleHeightGet() and ProTextStyleHeightSet() get and set the height of the text. The value -1.0 means that the text has the default height for text currently specified for the drawing.
ProTextStyleWidthGet() and ProTextStyleWidthSet() get and set the width factor of the text. The width factor is the ratio of the width of each character to the height. The value -1.0 means that the width factor has the default value for text currently specified for the drawing.
ProTextStyleSlantAngleGet() and ProTextStyleSlantAngleSet() get and set the slant angle of the text.
ProTextStyleThicknessGet() and ProTextStyleThicknessSet() get and set the line thickness of the text. The value -1.0 means that the text has the default thickness for text currently specified for the drawing.
ProTextStyleFontGet() and ProTextStyleFontSet() get and set the font used to display the text.
ProDtlnotetextUlineGet() and ProDtlnotetextUlineSet() get and set whether the text item is underlined. The default is no underline.
ProDtlnotetextStringGet() and ProDtlnotetextStringSet() get and set the string of characters contained in the text item.
The functions ProDtlnotetextStyleGet() and ProDtlnotetextStyleSet() retrieve and set the text style for the specified text as a ProTextStyle structure. It takes as input the ProDtlnotetext object.
The function ProTextStyleFree() frees the allocated data structure.
ProDtlnoteWrapTextGet() and ProDtlnoteWrapTextSet() get and set the wrap status of the text for a specified note in a drawing.
The function ProDtlnoteWrapTextSet() sets the text wrapping status to ON or OFF. The input arguments are listed below:
•  note—Specifies the note for which the wrap status is to be set.
•  wrap—Specifies if the text is wrapped. To wrap the text, specify the value as Pro_B_True.
•  wrapwidth—Specifies the width of the wrapped text line, if the input argument wrap is set to Pro_B_True.
Detail Note Line Data
Functions Introduced:
The ProDtlnoteline data structure describes the contents of a single line of text in a detail note.
ProDtlnotelineAlloc() and ProDtlnotelineFree() allocate and free a ProDtlnoteline structure.
ProDtlnotelineTextAdd() adds a text item, described by a ProDtlnotetext data structure, to a note line. If the line already contained text items, the new one is added at the end of the array.
ProDtlnotelineTextsSet() sets the contents of a whole text line, by providing a new array of ProDtlnotetext items. If the note line already contained text items, they are replace by the new ones.
ProDtlnotelineTextsCollect() outputs an array of the text items contained in a specified text line.
Points to note about Text Lines and parameterization:
•  If the string in a Text Line you put in a note contains one or more parameters, Creo Parametric will divide the Text Line into several Text Items to ensure that each parameter has its own Text Item.
•  When you look at the text in an existing note by using the function ProDtlnoteDataGet() with the mode option set to SYMBOLIC (that is, to see the text before substitution of the parameters), you will see the text bracketing and text item identifiers that you also see when you edit a text line in Creo Parametric.
For example, if you make a text line containing a single text item with the text
    "model = &model_name"
Creo Parametric will put the &model_name into a separate text item when the note is created. If you then use ProDtlnoteDataGet() on the created note with the mode option set to SYMBOLIC, you will see the following two text items in the relevant text line
    "model = "     "&model_name"
If you set mode to NUMERIC, you see these text items:
    "model = "     "MODEL"
where MODEL is the name of the model.
Note
Creo Parametric does not resolve and replace symbolic callouts for notes which are not displayed. Therefore, if the note is not displayed or is hidden in a layer, the text retrieved may contain symbolic callouts, even when the mode is set to NUMERIC.
Note that ProDtlnotetextStringGet() does not return the brackets and numbers for each individual text entity. In addition, the function does not return the special escape characters (such as \}) to represent characters previously provided.
Refer to the section Creating a Symbol Definition for a description of how to find which Creo Parametric model owns the parameter referred to by parameterized text.
Detail Attachments and Leaders
Functions Introduced:
The opaque data structure ProDtlattach is used for two tasks:
•  The way in which a drawing note or a symbol instance is attached to the drawing.
•  The way in which a leader on a drawing note or symbol instance is attached.
Each note and symbol instance must contain one ProDtlattach to describe its attachment in the drawing, and may contain any number of ProDtlattach objects describing the leaders.
ProDtlattachAlloc() allocates and initializes the memory for a detail attachment. The inputs are:
•  type—The type of attachment to the drawing view. The detail attachment types are as follows:
  FREE—The attachment is to a 2D location in the drawing view.
  PARAMETRIC—The attachment is to a point on a surface or an edge of a solid.
  OFFSET—The attachment is offset to another drawing view, to a model item, or to a 3D model annotation.
Note
You cannot attach a symbol to 3D model annotation using the OFFSET attachment type.
•  view—The drawing view. If the type is FREE, the attachment is relative to the drawing view, that is the attachment moves when the drawing view is moved. This is NULL, if the detail attachment is not related to the drawing view, but is placed at a specified location in the drawing sheet, or if the attachment is offset to a model item or to a 3D model annotation.
•  location—If the type is FREE or OFFSET, this argument provides the location of the attachment. This location is in screen coordinates for drawing items, symbol instances and surface finishes on flat-to-screen annotation planes, and in model coordinates for symbols and surface finishes on 3D model annotation planes. The distance from this location to the location of the item to which the detail item is attached (given by the argument attach_point) is saved as the offset distance for an OFFSET attachment.
•  attach_point—If the type is PARAMETRIC or OFFSET, this ProSelection structure provides the location of the item to which the detail item is attached. This includes the drawing view in which the attachment is made. If you are building this structure using ProSelectionAlloc(), set the location using ProSelectionUvParamSet(), and the drawing view using ProSelectionViewSet().
Use the function ProDtlattachSet() to set the above ProDtlattach information for an existing attachment.
The function ProDtlattachGet() unpacks the above information for an existing attachment. The output arguments are:
•  type—The type of attachment to the drawing view. The detail attachment types are as follows:
  FREE—The attachment is to a 2D location in the drawing view.
  PARAMETRIC—The attachment is to a point on a surface or an edge of a solid in a drawing view.
  OFFSET—The attachment is offset to another drawing view, to a model item, or to a 3D model annotation.
  UNIMPLEMENTED—The attachment is to an item that is not currently supported in Creo TOOLKIT. However, you can still retrieve the location and the view to which the attachment is connected.
  SUPPRESSED—The attachment is to an item, which is missing from the drawing or part.
•  view—If the type is FREE or UNIMPLEMENTED, this argument specifies the drawing view. This is NULL, if the detail attachment is not related to the drawing view, but is placed at a specified location in the drawing sheet, or if the attachment is offset to a model item or to a 3D model annotation.
•  location—If the type is FREE, OFFSET, or UNIMPLEMENTED, this argument specifies the location of the attachment. This location is in screen coordinates for drawing items, symbol instances and surface finishes on flat-to-screen annotation planes, and in model coordinates for symbols and surface finishes on 3D model annotation planes. The distance from this location to the location of the item to which the detail item is attached (given by the argument attach_point) is saved as the offset distance for an OFFSET attachment.
•  attach_point —If the type is PARAMETRIC or OFFSET, this argument provides the location of the item to which the detail item is attached. This includes the drawing view in which the attachment is made.
ProDtlattachFree() frees an attachment that was allocated with ProDtlattachAlloc().
The function ProDtlattachArrowtypeGet() returns the type of arrowhead used for the leaders attached to a drawing note or symbol instance. Use the function ProDtlattachArrowtypeSet() to assign the type of arrowhead.
Note
The functions ProDtlattachArrowtypeGet() and ProDtlattachArrowtypeSet() are applicable only for ProDtlattach leader attachment objects obtained using the functions ProDtlsyminstdataLeadersCollect() and ProDtlnotedataLeadersCollect().
The function ProDtlattachIsSuppressedGet() returns whether the attachment is suppressed. The input argument to this function is attach, which specifies the leader attachment structure.
The output argument to this function is_supp is set to true if the attachment is suppressed.
Detail Note Data
Functions Introduced:
The object ProDtlnotedata is an opaque pointer to a data structure that describes the contents of a drawing note.
ProDtlnotedataAlloc() and ProDtlnotedataFree() allocate and free memory for the data.
ProDtlnotedataIdGet() gives you the integer id of the note in Creo Parametric that the data describes. This will be set if the ProDtlnotedata has been acquired using ProDtlnoteDataGet(). It is not necessary to set this when creating a note; the function ProDtlnoteCreate() will assign an id to the new note.
ProDtlnotedataLineAdd() adds a ProDtlnoteline object to a ProDtlnotedata description. If the note already contains lines of text, the new line will be added at the end.
ProDtlnoteldataLinesSet() sets an array of ProDtlnoteline objects as the lines in a ProDtlnotedata description. If the note already contains text lines, they will be replaced by the new lines.
ProDtlnotedataLinesCollect() outputs an array of ProDtlnoteline objects describing the lines in a given ProDtlnotedata description.
ProTextStyleMirrorSet() specifies the option to mirror the note. Specify the input argument mirror to true to mirror the note. ProTextStyleMirrorGet() returns the mirroring option specified for the note.
ProTextStyleColorGetWithDef() and ProTextStyleColorSetWithDef() get and set the color for the note. If you do not call ProTextStyleColorSetWithDef() when creating a note, the note will have the default color defined by PRO_COLOR_METHOD_DEFAULT. Refer to the Draft Entity Data section for a fuller description of the ProColor object.
ProDtlnotedataAttachmentGet() and ProDtlnotedataAttachmentSet() get and set the ProDtlattach object which describes the attachment of the note, that is, where and how it is positioned on the drawing.
ProDtlnotedataLeadersCollect() outputs an array of ProDtlattach objects which described the attachment points of the leaders on the note. ProDtlnotedataLeadersSet() adds and array of leaders to a note, replacing existing leaders. ProDtlnotedataLeaderAdd() adds a new leader to the end of the array of current leaders on a note.
ProDtlnotedataElbowlengthGet() and ProDtlnotedataElbowlengthSet() get and set the length of the elbow that connects each leader to the note. If you do not call ProDtlnotedataElbowlengthSet() when creating a note, there will be no elbow.
The functions ProTextStyleAngleGet() and PProTextStyleAngleSet() get and set the angle of rotation of the note. If you do not call ProTextStyleAngleSet() when creating the note, the rotation defaults to 0.0.
The functions ProTextStyleJustificationGet() and ProTextStyleJustificationSet() return and set the horizontal justification for the text style object. The functions ProTextStyleVertJustificationGet() and ProTextStyleVertJustificationSet() return and set the vertical justification for the text style object. Vertical justification applies only to notes in drawing tables and OnItem notes.
ProDtlnotedataIsDisplayed() and ProDtlnotedataDisplayedSet() retrieve and set the flag that controls whether the note is visible or not. If the note is created with this flag set to true, regenerate the drawing using ProDwgDraftRegenerate() to see the displayed note.
ProDtlnoteDtlsyminstsCollect() returns a list of all the symbol instances that are declared in a detail note via the “sym()” callout format. The symbol instances are returned in the order they are encountered in the note text.
The functions ProDtlnotedataTextStyleGet() and ProDtlnotedataTextStyleSet() retrieve and set the text style for the specified note as a ProTextStyle structure. It takes as input the ProDtlnotedata object.
If the note has texts with different styles, the style returned by the function ProDtlnotedataTextStyleGet() will have mixed state for attributes. The attributes are not the same for all texts. In such a case of mixed attribute, if function such as ProTextStyleFontGet() is called, the error PRO_TK_GENERAL_ERROR is returned.
The function ProTextStyleFree() frees the allocated data structure.
The function ProDtlnoteTableCellGet() returns the information on the rows and columns within a table for the specified table note. The information is given by the following output arguments:
•  table—Specifies the table.
•  p_row—Specifies the indexed row that starts at 0.
•  p_col—Specifies the indexed column that starts at 0.
Example 10: Create Drawing Note at Specified Location with Leader to Surface and Surface Name
The sample code in the file UgDtlnoteExamples.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing, shows a function which creates a drawing note with a text style at a specified location, with a leader attached to a solid surface, and which shows the name of the surface.
Example 11: Create Drawing Note
The sample code in the file UgNoteCreate.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_dwg, shows a function which creates a drawing note with a text style that gives the default text height for the specified drawing.
Read-Only Notes
Functions Introduced:
You can make an existing drawing note unselectable by Creo Parametric users if you wish to protect it from modification. The functions ProDtlnotedataReadonlySet() and ProDtlnotedataReadonlyGet() set and get this property on ProDtlnotedata objects. Use function ProDtlnotedataReadonlySet() in conjunction with ProDtlnoteDataGet() and ProDtlnoteModify() to change the setting.
The function ProDrawingReadonlyselectionAllow() will temporarily allow the selection of read-only notes.
Parameterized Note Text
Function introduced:
A note in a drawing, or in a symbol definition, can be parameterized. This means that it contains the name of a parameter from a Creo Parametric model, preceded by a '&'. The '&' and the parameter name are replaced by the value of the parameter when the note is displayed, or when the symbol is instantiated.
The parameterizations in different notes and symbols in a single drawing may refer to parameters on different Creo Parametric models, depending upon the history of the drawing. The function ProDtlnoteModelrefGet() allows you to find out which model is referred to by a specific parameter.
Cross-referencing Gtols and Drawing Annotations
The functions described in this section provide the drawing object that represents a shown gtol (if the gtol is shown in the drawing), or vice-versa.
Functions Introduced:
The function ProGtolDtlnoteGet() returns the detail note that represents a shown geometric tolerance.
Note
This function returns the first detail note that calls out the geometric tolerance. Creo Parametric does not restrict users to showing only a single version of a geometric tolerance callout.
The function ProDtlnoteGtolGet() returns the geometric tolerance shown in a detail note, if applicable.
Cross-referencing 3D Notes and Drawing Annotations
The functions described in this section provide access to the drawing object that represents a shown 3D note, (if the 3D note is shown in the drawing), or vice-versa.
Functions Introduced:
The function ProNoteDtlnoteGet() returns a detail note that represents a shown model tree.
Note
This function returns the first detail note that calls out the solid model note. Creo Parametric does not restrict users to showing only a single version of a solid model note callout.
The function ProDtlnoteNoteGet() returns the solid model note that is displayed as a detail note, if applicable.
Symbol Definition Attachments
Functions Introduced:
A symbol definition has several different ways in which instances of that symbol can be attached to the drawing. In Creo Parametric users set these attachments from the General tab on the Symbol Definition Attributes dialog. Each attachment type is described in Creo TOOLKIT by an opaque data structure called ProDtlsymdefattach. This is allocated and filled by the function ProDtlsymdefattachAlloc(). The types of attachment are:
•  FREE—The symbol will have no leaders, and will be attached by a specified location.
•  ON_ITEM—The symbol will be attached to an entity in the drawing.
•  NORM_ITEM—The symbol will be attached to an entity, and be rotated to be normal to that entity.
•  LEFT_LEADER—The attachment is by a leader to a point on an entity at the left of the symbol.
•  RIGHT_LEADER—T he attachment is by a leader to a point on an entity at the right of the symbol.
•  RADIAL_LEADER—The attachment is by a leader attached to a circular entity in the symbol.
The input arguments to the function are these
•  type—The type of attachment
•  entity_id—The id of the entity in the symbol definition which has the attachment point, if the attachment type is *_LEADER.entity_parameter The “t” value of the location on the entity which forms the attachment point, if the attachment type is *_LEADER.
•  position—The location in the symbol coordinate system which forms the attachment point, if the attachment type is FREE, ON_ITEM, or NORM_ITEM.
Symbol Definition Data
Functions Introduced:
The opaque object ProDtlsymdefdata describes the contents of a symbol definition. The functions ProDtlsymdefdataAlloc() and ProDtlsymdefdataFree() allocate and free this data.
ProDtlsymdefdataIdGet() gives you the integer id of the symbol definition in Creo Parametric that the data describes. This will be set if the ProDtlsymdefdata has been acquired using ProDtlsymdefDataGet(). It is not necessary to set this when creating a symbol definition; the function ProDtlsymdefCreate() will assign an id to the new note.
ProDtlsymdefdataHeighttypeGet() and ProDtlsymdefdataHeighttypeSet() get and set the way in which the size of an instance of this symbol definition is set. The three types are:
•  FIXED—The symbol instance height is fixed.
•  VARIABLE—The symbol instance height may be modified by the Creo Parametric user.
•  TEXTRELATED—The symbol instance height is related to the height of a text item in the definition.
If the height type is TEXTRELATED the functions ProDtlsymdefdataTextrefSet() and ProDtlsymdefdataTextrefGet() set and get the text item in the symbol definition which determines the symbol instance height. The reference is by note id, line index, and text item index.
ProDtlsymdefdataElbowGet() and ProDtlsymdefdataElbowSet() get and set the bit flag representing the elbow of the symbol definition.
ProDtlsymdefdataTextangfixedGet() and ProDtlsymdefdataTextangfixedSet() get and set whether the angle of text in the symbol is fixed.
ProDtlsymdefdataScaledheightGet() returns the height of the symbol definition in inches.
ProDtlsymdefdataPathSet() and ProDtlsymdefdataPathGet() set and get the path and file name of the file in which the symbol definition may be saved. This is used to give the symbol its name.
ProDtlsymdefdataNameGet() gets the name of the symbol definition.
Creating a Symbol Definition
The notes and draft entities that are contained by a symbol definition are created using ProDtlentityCreate() and ProDtlnoteCreate(), using the ProDtlsymdef handle as the symbol argument. So you need to create the empty symbol definition first, and then add the notes and entities.
If you want to add parametric leader attachments, using ProDtlsymdefdataAttachAdd() and so on, these identify the entities to which the leaders should attach using the object handles output by the calls to ProDtlnoteCreate() and ProDtlentityCreate() that created them. So these attachment types should also be added after the symbol is created.
So the steps in creating a symbol definition are:
•  Allocate a description — ProDtlsymdefdataAlloc()
•  Add a FREE attachment — ProDtlsymdefattachAlloc(), ProDtlsymdefdataAttachAdd()
•  Create the symbol—ProDtlsymdefCreate()
•  Add the notes and entities (as for creating notes and entities in the drawing)
•  Add any leader attachments—ProDtlsymdefattachAlloc(), ProDtlsymdefdataAttachAdd()
Example 12: Create Symbol Definition
The sample code in the file UgDtlsymdefExamples.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing, shows a function which creates a symbol definition which contains four line entities forming a box, a note with text style at the middle of the box, and a free attachment.
Retrieving a Symbol Definition from Disk
Function introduced:
Creo Parametric symbols exist in two different areas: the user-defined area and the system symbols area.
The function ProDrawingDtlsymdefRetrieve() enables you to retrieve a symbol definition from the user-defined location designated by the configuration option pro_symbol_dir. The symbol definition should have been previously saved to a file using Creo Parametric.
The function ProDrawingSystemDtlsymdefRetrieve() retrieves a symbol definition from the system directory. The system area contains symbols provided by Creo Parametric with the Detail module (such as the Welding Symbols Library).
Symbol Instance Variable Text
Functions Introduced:
A symbol instance may replace any text inside a note in the symbol definition that is enclose in back slash characters. The opaque data structure ProDtlvartext describes such a substitution. It describes the “prompt” string, that is, the string in the symbol definition which it is replacing, and the “value”, that is, the new text string.
The function ProDtlvartextAlloc() allocates and initializes a ProDtlvartext object. ProDtlvartextFree() frees the memory, and ProDtlvartextDataGet() unpacks the information in a ProDtlvartext.
Symbol Instance Data
Functions Introduced:
ProDtlsyminstdataAlloc() and ProDtlsyminstdataFree() allocate and free a ProDtlsyminstdata description.
ProDtlsyminstdataDefSet() and ProDtlsyminstdataDefGet() set and get the reference to the symbol definition that this instance instantiates.
ProDtlsyminstdataAttachtypeSet() and ProDtlsyminstdataAttachtypeGet() set and get the type of attachment being chosen for the symbol instance. The corresponding attachment types much exist in the symbol definition.
If you want to make an attachment to a symbol instance of a type that was not specified in the symbol definition, you can add you own symbol definition attachment to the symbol instances. ProDtlsyminstdataDefattachSet() and ProDtlsyminstdataDefattachGet() set and get a ProDtlsymdefattach object on a symbol instance with this purpose.
ProDtlsyminstdataAttachmentGet() and ProDtlsyminstdataAttachmentSet() get and set the actual attachment for the symbol instance, that is, where it is positioned on the drawing, in the form of a ProDtlattach object. Refer to the section on Detail Attachments and Leaders for more information about this object. In Creo Parametric 10.0.0.0 and later, you can use the functions ProDtlsyminstdataAttachmentGet() and ProDtlsyminstdataAttachmentSet() to place 3D symbols as offset to other symbol, dimension, note or a datum target.
The function ProDtlsyminstDimattachGet() returns the dimension to which the specified symbol instance is attached. The function returns the error of type PRO_TK_BAD_CONTEXT when the dimension to which the specified symbol instance is attached is not available. In this case, the model containing the dimension was either deleted or suppressed in the assembly.
ProDtlSyminstElbowlengthGet() gets the elbow properties of the symbol in 3D. The input argument p_sym_inst is the symbol instance that is defined by ProDtlsyminst. The output arguments are:
•  op_elbow_length—Specifies the elbow length in model units for annotation plane symbols.
•  elbow_direction—Specifies the elbow direction in the model's coordinate system. This is the direction from the symbol text to the symbol leaders that is defined by ProVector.
ProDtlsyminstdataLeaderAdd() adds a leader to a symbol instance description.
ProDtlsyminstdataLeadersSet() sets an array of leaders in a symbol instance, replacing any existing leaders.
Note
To remove all the leaders from the symbol instance data, pass NULL as the value for the input argument leaders and set the attachment type to PROSYMDEFATTACHTYPE_FREE.
ProDtlsyminstdataLeadersCollect() outputs an array of the leaders on a ProDtlsyminstdata description.
ProDtlsyminstdataElbowlengthGet() and ProDtlsyminstdataElbowlengthSet() get and set the length of the elbow that connects each leader to the symbol instance. If you do not call ProDtlnotedataElbowlengthSet() when creating a symbol instance, there will be no elbow.
ProDtlsyminstdataAngleSet() and ProDtlsyminstdataAngleGet() get and set the rotation angle of the symbol, if the symbol definition allows rotation. (See also the function ProDtlsymdefdataTextangfixedSet() in the section on Symbol Definition Data.)
ProDtlsyminstdataScaledheightSet() and ProDtlsyminstdataScaledheightGet() assign and return the height of a symbol instance in the units of the owner drawing or model, respectively. This value is consistent with the height value shown for a symbol instance in the Properties dialog box in the Creo Parametric user interface.
Note
The scaled height obtained using the above functions is partially based on the properties of the symbol definition assigned using the function ProDtlsyminstdataDefSet(). Changing the symbol definition may change the calculated value for the scaled height.
ProDtlsymInstnoteDataGet() and ProDtlsymInstentityDataGet() retrieve the data of a note and an entity, respectively, in the symbol instance.
The function ProDtlsyminstdataIsDisplayed() checks if the specified instance is not marked as erased. The function ProDtlsyminstdataDisplayedSet() sets the flag which controls whether or not the instance is marked as displayed.
The function ProDtlsyminstdataIsInvisible() checks if the specified instance is invisible. An invisible symbol instance will not appear in the drawing even if it marked as displayed. For example:
•  if the symbol is in a draft group, which is marked as suppressed
•  if the symbol is a BOM balloon, and the repeat region cannot find an appropriate model
•  if the symbol is a weld symbol, and its feature is suppressed
•  if the symbol is a datum target symbol, and its feature is suppressed
ProDtlsyminstdataVartextAdd(), ProDtlsyminstdataVartextsSet(), ProDtlsyminstdataVartextsCollect() manipulate ProDtllvartext objects in the symbol instance, which provide for substitution of text in the symbol definition. See section Symbol Instance Variable Text for more information about the ProDtlvartext object.
The function ProDtlsyminstdataTransformGet() provides a matrix that describes the transformation between symbol definition coordinates and screen coordinates for this instances, that is, it describes the location and orientation of the symbol. The symbol coordinates are specified in inches.
The function ProDtlsyminstdataGroupoptionsSet() sets the option for displaying groups in the symbol instance. The possible options are:
•  Interactive—prompt the user to select the groups to activate
•  All—activate all groups
•  None—do not activate any group
•  Custom—activate only those groups included in the array of ProDtlsymgroup handles passed to this function.
See Drawing Symbol Groups to learn more about accessing groups during symbol placement.
The function ProDtlsyminstEntitiesVisibleGet() returns the visible entities in the symbol instance data. The input argument sym_inst is the symbol instance that displays the symbol added to the drawing.
The function ProDtlsyminstIsDatumTarget() checks if the specified symbol instance is a datum target. This function returns PRO_B_TRUE if the specified symbol instance is a datum target and returns PRO_B_FALSE if it is not.
The function ProDtlsyminstEnvelopeGet() returns the envelope of the symbol. While retrieving coordinates of the symbol in a specified solid, if the symbol is displayed in the solid as well as in the drawing, the drawing must not be active. The input arguments follow:
•  syminst—Symbol.
•  drawing—Drawing. The value for this input argument must be passed only if the solid symbol is shown in the drawing. Else, pass it as NULL.
•  path—If the value of the input argument drawing is not NULL, then the path points to a part in an assembly whose drawing is passed here. This part is the owner of the symbol instance.
The output argument envelope is the envelope surrounding the symbol in the model coordinate system. For drawing, the envelope surrounding the symbol is in the screen coordinates.
The function ProDtlsyminstReferencesAdd() adds semantic references to a specified symbol. The input arguments follow:
•  syminst—Specifies the symbol to which the semantic references are to be added.
•  refs—Specifies the array of semantic references using the enumerated data type ProAnnotationReference.
Note
When a reference includes more than one collection, the function ProDtlsyminstReferencesAdd() returns the error PRO_TK_MAX_LIMIT_REACHED and no reference is added.
The function ProDtlsyminstReferencesGet() returns a ProArray of additional semantic references for a symbol.
Use the function ProAnnotationreferencearrayFree() to free the ProArray.
The function ProDtlsyminstReferenceDelete() deletes the additional semantic references. The input arguments are as follows:
•  syminst—Symbol from which the additional semantic references are to be deleted.
•  index_ref—Specifies the index of the references that need to be deleted. Indices start from 0. Get the existing references from ProDtlsyminstReferencesGet().
The function ProDtlsyminstSurffinGet() gets the owner surface finish from the symbol instance cosmetic. The input arguments are:
•  syminst—Symbol to which the semantic references are to be added using the ProDtlsyminst object.
The output argument surf_fin is the owner surface finish item using the ProSurfFinish object.
Cross-referencing Weld Symbols and Drawing Annotations
The functions described in this section provide a drawing object that represents a shown weld symbol (if the weld symbol is shown in the drawing), or the weld feature that owns a shown weld symbol.
Functions Introduced:
The function ProFeatureDtlsyminstGet() returns the detail symbol instance that represents a shown model symbol.
The function ProDtlsyminstFeatureGet() returns the weld feature that owns the shown weld symbol.
Example 13: Create Free Instance of Symbol Definition
The sample code in the file UgDtlsyminstExamples.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing, shows a function which creates a free instance of a symbol definition.
Detail Group Data
Functions Introduced:
ProDtlgroupdataAlloc() and ProDtlgroupdataFree() allocate and free a detail group structure in the form of a ProDtlgroup object. ProDtlgroupdataAlloc() also sets the name of the group.
ProDtlgroupdataIdGet() returns the internal ID of an existing group. ProDtlgroupdataNameGet() gets the name of the group.
ProDtlgroupdataDisplayedSet() and ProDtlgroupdataIsDisplayed() set and get the flag that controls whether or not the group is visible.
ProDtlgroupdataItemAdd() adds an item to the group contents. Items supported in the groups include entities, notes, symbol instances, and draft drawing dimensions.
ProDtlgroupdataItemsSet() sets the array of items into a group structure, replacing any existing items that may have been assigned.
ProDtlgroupdataItemsCollect() returns an array of the items in the group structure.
Example 14: Create New Group of Items
The sample code in the file UgDtlgroupExamples.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing, shows a command which creates a group from a set of selected detail items.
Drawing Symbol Groups
This section describes Creo TOOLKIT functions that give access to user-defined groups contained in drawing symbols.
User-defined groups in symbol definitions are represented by the following handle in Creo TOOLKIT:
typedef struct pro_dtlvargroup 
{
 ProDtlsymdef symbol_def;
 int var_group_id;
} ProDtlsymgroup;
The group handle contains the definition handle and an identifier that is unique in the group definition.
Creo Parametric allows a hierarchal relationship between the groups in a symbol definition. Thus, some groups contain groups, or are parents of other groups. To transmit the “level” in which a group resides to Creo TOOLKIT functions, pass the ProDtlsymgroup handle of the parent group. To look at the groups at the top level, pass a ProDtlsymgroup handle with an identifier of -1.
Identifying Symbol Groups in an Instance
Function introduced:
The function ProDtlsyminstSymgroupsCollect() indicates which groups are included in the symbol instance. You can collect the groups based on their status:
•  All—retrieve all groups in the definition of the symbol instance
•  Active—retrieve only those groups which are actively shown in this symbol instance
•  Inactive—retrieve only those groups which are not shown in this symbol instance
Identifying Symbol Groups in a Definition
Functions Introduced:
The function ProDtlsymgroupSubgroupsCollect() returns the names of all subgroups stored in the symbol definition at the indicated level.
Use the function ProDtlsymgroupDataGet() to get the data for the group stored in the symbol definition.
The function ProDtlsymgroupdataNameGet() returns the name of the group using the symbol group data as input, while the function ProDtlsymgroupdataItemsCollect() returns the names of all the group members using symbol data as input. Note that all these group members are entities or notes contained only within the symbol definition.
The function ProDtlsymgroupParentGet() returns the parent group to which the current group belongs.
The function ProDltsymgroupLevelIsExclusive() indicates if the subgroups stored in the symbol definition at the current level are exclusive or independent. If groups are exclusive, only one of the groups at this level may be active in the model at any time. If groups are independent, any number of groups may be active.
Manipulating Symbol Groups
Functions Introduced:
The opaque handle ProDtlsymgroupdata contains the information needed to define or redefine a group.
The function ProDtlsymgroupdataAlloc() allocates the data structure.
The function ProDtlsymgroupdataNameSet() sets the name of the symbol group while the function ProDtlsymgroupdataItemsSet() sets the specified items to be contained in the symbol group, provided such items belong to the symbol definition. The items to be included can be detail entities and notes.
The function ProDtlsymgroupdataItemAdd() adds a single item to the symbol group, provided such an item belongs to the symbol definition. The item to be added can be a detail entity or a note.
The function ProDtlsymgroupdataFree() frees the data structure.
The function ProDtlsymgroupSubgroupCreate() creates a new group in the symbol definition at the specified level below the parent group.
The function ProDtlsymgroupModify() modifies the symbol group definition.
The function ProDtlsymgroupDelete() deletes a group from the symbol definition. This function does not delete the entities contained in the group.
The function ProDtlsymgroupLevelExclusiveSet() makes the groups at the indicated level, exclusive or independent, in the symbol definition.
Drawing Edges
The functions described in this section provide access to the display properties such as color, line font, and thickness of model edges in drawing views. Model edges can be regular edges, silhouette edges, or non-analytical silhouette edges.
The opaque handle ProDrawingEdgeDisplay provides access to the display properties of model edges.
Note
You can select model edges from detailed views for modification, but no change will be applied. To modify the display of a model edge in a detailed view, you must select the edge in the parent view.
Functions Introduced:
The function ProDrawingEdgeDisplayGet() obtains the display properties of a specified model edge in a drawing view. It allocates the ProDrawingEdgeDisplay object for storing the display properties.
The function ProDrawingEdgeDisplaySet() assigns the display properties of a specified model edge in a drawing view. After assigning the properties, you must repaint the drawing view to update the display.
The function ProDrawingedgedisplayFree() frees the memory allocated for the ProDrawingEdgeDisplay object.
The functions ProDrawingedgedisplayColorGet() and ProDrawingedgedisplayColorSet() obtain and assign the color to be used for the display of a specified model edge.
The functions ProDrawingedgedisplayFontGet() and ProDrawingedgedisplayFontSet() obtain and assign the line font to be used for the display of a specified model edge.
The functions ProDrawingedgedisplayWidthGet() and ProDrawingedgedisplayWidthSet() obtain and assign the width to be used for the display of a specified model edge. You must pass a value less than zero to use the default width.
Note
The width obtained is in screen coordinates. To convert the width value into drawing coordinates, use the sheet transformation matrix obtained using ProDrawingSheetTrfGet().
The function ProDrawingedgedisplayIsGlobal() determines if the model edge display properties such as color, line font, and width have been applied globally to all the drawing views in the drawing sheet.
The function ProDrawingedgedisplayGlobalSet() sets the flag that assigns the model edge display properties such as color, line font, and width globally to all the drawing views in the drawing sheet.
Creating BOM Balloons
BOM balloons are circular callouts created in an assembly drawing. They shows the Bill of Materials information for each component. You can add the BOM balloons in the drawing using the functions described in this section.
Before you can add BOM balloons, you must create a table, add the repeat region, enter the desired report symbols, and designate the BOM balloon region. After this you can show BOM balloons on a selected assembly view.
Functions Introduced:
The function ProDwgtableCellRegionGet() returns the ID of the repeat region. You must specify the name of the table, the column and row ID as input parameters.
The function ProBomballoonCreate() creates the BOM balloons at the specified view. The input arguments are:
•  pro_drawing—Specifies the name of the drawing.
•  pro_table—Specifies the name of the table that contains the repeat region and the bill of material.
•  region_id—Specifies the ID of the repeat region that contains the bill of material. If the ID of the repeat region in the table is -1, use the repeat region with ID as 0 in the table.
•  pro_view—Specifies the view where the balloons must be added.
The function ProBomballoonAllCreate() creates the BOM balloons to the first view of the drawing.
The function ProBomballoonByComponentCreate() creates the balloons at the specified view and on the specified component. If the view is specified as NULL, the balloons are added to the first view of the drawing. Specify the path to the component as component_memb_id_tab.
The function ProBomballoonByRecordCreate() creates the balloons for the specified record in the BOM table. The input arguments are:
•  pro_drawing—Specifies the name of the drawing.
•  pro_table—Specifies the name of the table that contains the repeat region and the bill of material.
•  region_id—Specifies the ID of the repeat region that contains the bill of material.If the ID of the repeat region in the table is -1, use the repeat region with ID as 0 in the table.
•  pro_view—Specifies the view where the balloons must be added. Specify this argument to create the balloons without a leader.
•  table_record_index—Specifies the record in the BOM table. The balloons are created at the first component that matches the specified record.
•  reference_memb_id_tab—Specifies the path to the component. This path is used as reference for the leader of the balloon.
•  reference_id—Specifies the ID of the component. When the ID is set to K_NOT_USED, the balloons are attached without leaders.
•  reference_type—Specifies the type of component using the enumerated data type ProType.
•  attach_note_location—Specifies a ProArray of the attachment point for the balloons on the component.
The function ProBomballoonClean() cleans up the location and display of BOM balloons in the specified view. The input arguments are:
•  pro_drawing—Specifies the name of the drawing.
•  pro_view—Specifies the view where BOM balloons have been added.
•  clean_pos—Specifies a boolean value to indicate if the balloon must be cleaned.
•  existing_snap_lines—Specifies a boolean value to indicate if the existing snap lines must be used for the clean up.
•  offset_from_view_outline—Specifies the offset distance for the balloon placement from the view outline.
•  stagger—Specifies a boolean value to indicate if the balloons must be staggered at different offset distance from the view outline.
•  create_stagger_snap_lines—Specifies the incremental value for the stagger distance between the snap lines.
•  interballoons_distance—Specifies the distance between the BOM balloons.
•  attach_to_surface—Specifies if the leaders of the balloon must point to edges or surfaces. To attach the leader to a surface specify the value as PRO_B_TRUE.
Drawing Dimensions
This section describes Creo TOOLKIT functions that give access to the types of dimension that can be created in drawing mode. They do not apply to dimensions which are created in solid mode, either those created automatically as a result of feature creation, or reference dimensions created in a solid.
The ProDimension object is introduced in the section on Dimensions; read the explanation of ProDimension at the start of that section before reading further.
Dimensions created in drawing mode are stored either in the solid or in the drawing, depending upon the setting of the config.pro option CREATE_DRAWING_DIMS_ONLY. The default is NO, meaning that the dimensions will be stored in the solid. Refer to the Creo Parametric Detailed Drawings Help for more information on the various types of created dimension, and their behavior.
The owner field in the ProDimension object always refers to the model in which the dimension is stored.
The function ProDrawingDimensionVisit(), described in the section on Dimensions, can be used to find all the dimensions stored in a drawing.
Drawing Dimension Attachments and Dimension Creation
Functions Introduced:
The function ProDrawingDimAttachpointsGet() retrieves the entities to which a dimension is attached and the type of attachments. This is applicable only for dimensions created in the drawing mode.
Note
Dimensions created in solid mode are stored in a different way from those created in a drawing, because of their different role, and their attachments are not accessible to this function. If the function is called for a function created in solid mode, it will return an error.
The information about the entities to which the dimension is attached is given by the following output arguments:
•  attachments_arr—Specifies a ProArray of entities to which a dimension is attached. Each attachment point is described by two consecutive array elements, of which the second one may be NULL. If both elements are not NULL, then the attachment point refers to the intersection of the elements. If the second element is NULL, then the attachment point refers to the first one.
•  dsense_arr—Specifies a ProArray of ProDimSense that gives more information about how the dimension attaches to the entities.
ProDimSense is declared in header file ProDimension.h. This is the declaration:
typedef struct pro_dim_sense {
    ProDimSenseType       type;
    int                   sense;
    ProDimAngleSense      angle_sense;
    ProDimOrient          orient_hint;
} ProDimSense;
The type field indicates what type of information is being provided by the sense and/or angle_sense fields. The following sections list the values of ProDimSenseType with an explanation of the value of sense and angle_sense needed in each case.
Note
Some of the explanations below refer to the direction of an entity. Each entity (which includes 3D edges and curves, and 2D draft entities) has an inherent direction which is the direction in which its parameter “t” increases. In the data structure description of the entity, ProCurvedata, the first end specified is always the end at which t=0. For example, the direction of a line entity is from field end1 to end2 in ProLinedata.
•  PRO_DIM_SNS_TYP_NONE — In this case, no other information is needed to describe the attachment points. For example, if there is a single attachment which is a straight line, the dimension is the length of the line; if the attachments are two parallel lines, the dimension is the distance between them.
•  PRO_DIM_SNS_TYP_PNT — In this case the sense field is set to a value of the enum ProPointType (declared in the header ), which specifies the part of the entity to which the dimension is attached. The possible values are these:
  PRO_POINT_TYP_END1 — The first end (that is, where “t” = 0)
  PRO_POINT_TYP_END2 — The second end (that is, where “t” = 1.0)
  PRO_POINT_TYP_CENTER — The center, if entity is an arc or a circle
  PRO_POINT_TYP_NONE — This is equivalent to setting type to PRO_DIM_SNS_TYP_NONE
  PRO_POINT_TYP_MIDPT — The midpoint of the entity (where “t” = 0.5)
•  PRO_DIM_SNS_TYP_SPLN_PNT — This means that the attachment is to a point of a spline. The sense field is set to the index of the spline point.
•  PRO_DIM_SNS_TYP_TGT_IDX — The dimension attaches to a tangent of the entity, which is an arc or circle. The sense field is set to the index of the tangent in a list of all possible tangents ordered by the “t” value at which they touch the entity.
•  PRO_DIM_SNS_TYP_LIN_AOC_TGT — The dimension is the perpendicular distance between a line and a tangent to an arc or a circle which is parallel to the line. The value of sense is one of the values of the enum ProDimLinAocTgtSense. If the two possible tangents are on different sides of the line entity (because the distance from the line to the center is less than the radius) then the two tangents are distinguished as left or right of the line (with respect to its natural direction). If the two tangents are on the same side of the line (because the distance from the line to the center is more than the radius), the two tangents are distinguished as on the same side of the arc/circle center (0) or on the opposite side (1). There is an enum value for each of the four possible combinations of ways to identify a tangent, though of course only two are possible for a particular line and arc/circle pair.
The four values of ProDimLinAocTgtSense are:
•  PRO_DIM_LIN_AOC_TGT_LEFT0—The tangent is to the left of the line, and on the same side of the center of the arc/circle as the line.
•  PRO_DIM_LIN_AOC_TGT_RIGHT0—The tangent is to the right of the line, and on the same side of the center of the arc/circle as the line.
•  PRO_DIM_LIN_AOC_TGT_LEFT1—The tangent is to the left of the line, and on the opposite sid of the center of the arc/circle to the line.
•  PRO_DIM_LIN_AOC_TGT_RIGHT1—The tangent is to the right of the line, and on the opposite side of the center of the arc/circle to the line.
•  PRO_DIM_SNS_TYP_ANGLE — The dimension is the angle between two straight entities. The field angle_sense is given by the structure ProDimAngleSense which contains three boolean fields. They have the following meaning:
  is_first—Is set to TRUE if the angle dimension starts from this entity in a counterclockwise direction; FALSE if the dimension ends at this entity. The value must be TRUE for one entity, and FALSE for the other.
  should_flip—If should_flip is FALSE, and the entity's inherent direction is away from the angle vertex, then the dimension attaches directly to the entity. If the entity's direction is towards the angle vertex, the dimension is attached to a witness line which is in line with the entity but on the opposite side of the angle vertex—If should_flip is TRUE, then these cases are interchanged.
  pic_vec_dir—Reserved for future use.
•  PRO_DIM_SNS_TYP_PNT_ANGLE—The dimension is the angle between a line entity and the tangent to a curved entity at one of its ends. The curve attachment is of this type. (The line attachment is of the type PRO_DIM_SNS_TYP_PNT described above.) In this case both the angle and angle_sense fields must be set: sense shows which end of the curve the dimension is attached to; angle_sense shows the direction in which the dimension rotates and in which side of the tangent it attaches.
The field orient_hint describes the orientation of the dimension in cases where this cannot be deduced from the attachments themselves. (When such a dimension is created interactively in Creo Parametric, the user is prompted for the extra information.) For example, if the attachments are datum points that are not vertically or horizontally aligned, Creo Parametric needs to know whether the dimension is to be horizontal, vertical, or slanted. The hint refers to the dimension itself, not the attachment, although it is a field in ProDimSense. Creo Parametric looks at the value of orient_hint in the first item in the ProDimSense array you provide.
The values of ProDimOrient are:
•  PRO_DIM_ORNT_NONE—No orientation information is needed or provided.
•  PRO_DIM_ORNT_HORIZ—The dimension is horizontal
•  PRO_DIM_ORNT_VERT—The dimension is vertical
•  PRO_DIM_ORNT_SLANTED—The dimension is slanted
•  PRO_DIM_ORNT_ELPS_RAD1—The major diameter of an ellipse
•  PRO_DIM_ORNT_ELPS_RAD2—The minor diameter of an ellipse
•  PRO_DIM_ORNT_ARC_ANG—The angle of an arc
•  PRO_DIM_ORNT_ARC_LENGTH—The length of an arc
•  PRO_DIM_ORNT_LIN_TANCRV_ANG—If the dimension is attached to a line and an end point of a curve, the default dimension will be a linear dimension showing the distance between the line and the curve point. If you want the dimension to show instead the angle between the line and the tangent at the curve point, set “orient_hint” to this value.
This function ProDrawingDimensionAttachmentsSet() modifies the attachment information for a reference or driven dimension created in a drawing.
The input arguments are as follows:
•  drawing—Handle to the drawing in which the dimension was created.
•  dimension— The dimension type PRO_REF_DIMENSION or PRO_DIMENSION.
•  attachments_arrProArray of entities to which a dimension is attached.
•  dsense_arrProArray of a dimension sense.
•  orient_hint—The orientation hint for the dimension.
The function ProDrawingDimAttachpointsViewGet() retrieves the attachments and sense of the specified drawing dimension. This is applicable only for dimensions that are created in the drawing mode. This function fetches and interprets the attachment in the context of the view in which the dimension is placed. The function ProDrawingDimAttachpointsViewGet() supports drawing dimensions that are created from intersections of geometric entities.
The information about the entities to which the dimension is attached is given by the following output arguments:
•  attachments_arr—Specifies a ProArray of entities to which a dimension is attached. Each attachment point is described by two consecutive array elements, out of which the second one may be a NULL. If both elements are not NULL, the attachment point refers to the intersection of the elements. If the second element is NULL, the attachment point refers to the first one.
•  dsense_arr—Specifies a ProArray of ProDimSense that provides more information on how the dimension attaches to the entities.
. The function ProDrawingDimensionCreate() creates a dimension in a drawing. It takes as input an array of ProSelection objects and an array of ProDimSense structures that describe the required attachments. It will store the new dimension in the solid or the drawing depending upon the setting of the config.pro option CREATE_DRAWING_DIMS_ONLY. Specify the orientation of the dimension in the input argument orient_hint. You can create dimensions that have intersection type of reference. The intersection type of reference is a reference that is derived from the intersection of two entities. Refer to the Creo Parametric Detailed Drawings Help for more information on intersection type of reference.
The dimension will be added to the drawing view specified in the ProSelection object. If you want to build the attachment ProSelection object programmatically by calling ProSelectionAlloc(), rather than interactively using ProSelect(), call the function ProSelectionViewSet() to ensure that your ProSelection specifies the drawing view.
The function outputs a ProDimension object to identify the new dimension.
Ordinate Dimensions
Functions Introduced:
The function ProDrawingDimIsOrdinate() tells you whether a particular dimension is an ordinate dimension. If so, it also outputs a ProDimension object to identify the baseline dimension being referenced.
The function ProDrawingOrdbaselineCreate() converts a specified dimension to an ordinate baseline dimension. The choice of which end of the dimension becomes the baseline is made by an input of type ProVector which should be close to the appropriate attachment entity, and be in 3D solid coordinates. The function outputs a new ProDimension object which is used to identify the baseline dimension when converting to ordinate other dimensions which should share that baseline.
The function ProDrawingDimToOrdinate() converts an existing linear dimension to ordinate. It requires as one of its inputs a ProDimension object that was output from ProDrawingOrdbaselineCreate() as input to identify the baseline.
The function ProDrawingDimToLinear() converts an existing ordinate dimension to linear.
The last three functions in this section all update the display of the dimension if it is currently displayed.
Example 16: Command Creation of Datum Point Table
The sample code in the file UgDrawingDimensions.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing, shows a command which creates vertical and horizontal ordinate dimensions from each datum point in a model in a drawing view to a selected coordinate system datum.
Other Drawing Dimension Properties
Functions Introduced:
If you create a dimension which attaches only to draft entities in the drawing, the dimension may be associative or non-associative. This setting depends on the setting of the drawing setup option associative_dimensioning. The associative status of a dimension remains even when the setup option changes, so a drawing may contain dimensions of both types. The function ProDrawingDimIsAssociative() tells you whether or not a particular dimension is associative. Refer to the Drawing User's Guide for a fuller description of associative draft dimensions.
The function ProDrawingDimensionIsDisplayed() identifies whether a drawing dimension is displayed in the drawing.
The function ProDrawingDimensionIsToleranceDisplayed() identifies whether the tolerance value is displayed on the drawing dimension.
The function ProDrawingDimensionViewGet() tells you what drawing view a dimension is being displayed in. ProDrawingDimSwitchView() allows you to switch it's display to another view. Note that not all views will support the display of particular dimension.
The function ProDrawingDimensionPosGet() returns the position of the center of the text box for the specified dimension. The coordinates returned by this function cannot be used in the function ProDrawingDimensionMove(). Use the function ProDimlocationTextGet() instead of the function ProDrawingDimensionPosGet().
The function ProDrawingDimensionMove() allows you to move the dimension text to a new position on the drawing. Use the function ProDimlocationTextGet() to get the position before and after the move.
The function ProDrawingDualDimensionGet() identifies whether a drawing is using dual dimensioning, and also specifies the properties of the dual dimensioning.
The function ProDimensionDualOptionsGet() gets information about the display options for the specified dual dimension. In the input argument drawing, specify the drawing in which the dimension is displayed. To specify a dimension in owner model, specify the argument value as NULL. The output arguments are:
•  type—From Creo Parametric 5.0.0.0 onward, this argument is no longer supported. Specifies the type of display for primary and secondary dimension using the enumerated data type ProDualDimensionDisplayType. The valid values are:
  PRO_SECONDARY_DIM_DISPLAY_OFF—Specifies that secondary dimension is not displayed in a dual dimension.
  PRO_SECONDARY_DIM_DISPLAY_BOTTOM—Specifies that the secondary dimension must be placed below the primary dimension.
  PRO_SECONDARY_DIM_DISPLAY_RIGHT—Specifies that the secondary dimension on the same line as the primary dimension, on the right side.
•  secondary_unit—From Creo Parametric 5.0.0.0 onward, this argument is no longer supported. Specifies the name of the unit for secondary dimension.
•  dim_decimals—Specifies the number of decimal places for the secondary dimension.
•  tol_decimals—Specifies the number of decimal places for tolerance in the secondary dimension.
Use the function ProDimensionDualOptionsSet() to set the display options for dual dimensions. From Creo Parametric 5.0.0.0 onward, the arguments type and secondary_unit are no longer supported for the function ProDimensionDualOptionsSet().
The function ProDrawingDimensionPathGet() extracts the component path for a dimension displayed in a drawing.