Interface: Data Exchange
This section describes various methods of importing and exporting files in Creo TOOLKIT.
Exporting Information Files
Functions Introduced:
The function ProOutputFileMdlnameWrite() is used to create files of several types from data in Creo Parametric. This function operates only on the current object. The file types are declared in ProUtil.h. The export formats and their type constants are as listed in the following table.
Export Format
Creo TOOLKIT function
Type Constant
Bills of material
ProOutputFileMdlnameWrite()
PRO_BOM_FILE
Drawing setup file
PRO_DWG_SETUP_FILE
Feature identifier
PRO_FEAT_INFO, PRO_FEAT_INFO
Material file (currently assigned material)
PRO_MATERIAL_FILE
CL Data output, NC Sequence file
PRO_MFG_FEAT_CL
CL Data operation file
PRO_MFG_OPER_CL
Information on Creo Parametric Objects
PRO_MODEL_INFO
Program file
PRO_PROGRAM_FILE
Cable Parameters file
PRO_CABLE_PARAMS_FILE
Connector Parameters file
PRO_CONNECTOR_PARAMS_FILE
Spool file
PRO_SPOOL_FILE
Difference Report file
PRO_DIFF_REPORT_FILE
IGES file
PRO_IGES_FILE
DXF file
PRO_DXF_FILE
DWG file
PRO_DWG_FILE
Render file
PRO_RENDER_FILE
SLA ASCII file
PRO_SLA_ASCII_FILE
SLA Binary file
PRO_SLA_BINARY_FILE
INVENTOR file
PRO_INVENTOR_FILE
CATIA facets file
PRO_CATIAFACETS_FILE
IGES 3D file
PRO_IGES_3D_FILE
STEP file
PRO_STEP_FILE
VDA file
PRO_VDA_FILE
FIAT file
PRO_FIAT_FILE
CATIA DIRECT file
PRO_CATIA_DIRECT_FILE
ACIS file
PRO_ACIS_FILE
CGM file
PRO_CGM_FILE
The option PRO_RELATION_FILE creates a file that contains a list of all the model relations and parameters.
To access parameters on the connector entry ports, you must call the functionProOutputFileMdlnameWrite() with the option PRO_CONNECTOR_PARAMS_FILE. The function writes a text file to disk. This text file is in the same format as the file that you edit when using the Creo Parametric command Connector  Modify Parameters  Mod Param.
To generate and export a difference report to text or CSV format, call the function ProOutputFileMdlnameWrite() with the option PRO_DIFF_REPORT_FILE.
Note
As this report is generated and exported from the Creo Parametric embedded browser, using this output type will cause Creo Parametric to show the difference report in the browser.
For some of the options used with ProOutputFileMdlnameWrite(), you must provide some more information, using the last four arguments. The following list shows the arguments to be set and when:
•  For PRO_RENDER_FILE, PRO_INVENTOR_FILE, PRO_CATIAFACETS_FILE, PRO_SLA_ASCII_FILE, and PRO_SLA_BINARY_FILE, set the following argument:
  arg1—The name of the coordinate system. If this NULL, the function uses the default coordinate system.
•  For PRO_SPOOL_FILE, set arg1 to the spool name.
•  For PRO_FEAT_INFO, PRO_MFG_FEAT_CL, and PRO_MFG_OPER_CL, set the following argument:
  arg2—The integer identifier of the feature.
•  For PRO_IGES_3D_FILE, PRO_STEP_FILE, PRO_VDA_FILE, PRO_FIAT_FILE, PRO_CATIA_DIRECT_FILE, or PRO_ACIS_FILE, set the following argument:
  arg2—The integer pointer to an odd or even number.
•  For PRO_CGM_FILE, set the following arguments:
  arg2—Represents the integer pointer to the export type PRO_EXPORT_CGM_CLEAR_TEXT or PRO_EXPORT_CGM_MIL_SPEC.
  arg3—Represents the integer pointer to the scalar type PRO_EXPORT_CGM_ABSTRACT or PRO_EXPORT_CGM_METRIC.
•  For PRO_CONNECTOR_PARAMS, set the following arguments:
  arg1—Represents the integer pointer to ProIdTable. ProIdTable is an integer array of component identifiers.
  arg2—Represents the integer pointer to the number of component identifiers.
•  For PRO_CABLE_PARAMS_FILE, set the following arguments:
  arg1—Represents a ProSolid (part pointer).
  arg2—Represents the cable name.
•  For PRO_DIFF_REPORT_FILE, set the following argument:
  arg4—Represents the model to which the input model is compared to generate the difference report.
•  For PRO_RELATION_FILE, set the following argument:
  arg2—Represents the individual feature relations. It is an integer pointer to the feature identifier that gets the relations contained in a feature. If this is NULL you get the relations contained in the model.
Exporting 2D Models
Functions Introduced:
Export Format
Creo TOOLKIT Functions
Type Constant
STEP
Pro2dExport()
PRO_STEP_FILE
IGES
PRO_IGES_FILE
MEDUSA
PRO_MEDUSA_FILE
DXF
PRO_DXF_FILE
DWG
PRO_DWG_FILE
CGM
PRO_CGM_FILE
TIFF
PRO_SNAP_TIFF_FILE
Stheno
PRO_STHENO_FILE
DXF
ProOutputFileMdlnameWrite()
PRO_DXF_FILE
DWG
PRO_DWG_FILE
CGM file
PRO_CGM_FILE
PVS file, Plot file
ProProductviewFormatted
Export()
PRO_PV_FORMAT_PVS
ED file, Plot file
PRO_PV_FORMAT_ED
EDZ file
PRO_PV_FORMAT_EDZ
PVZ file
PRO_PV_FORMAT_PVZ
Plot file
ProPrintExecute()
N/A
The function Pro2dExport() exports existing two-dimensional models into a single object file. The exported model can be a single drawing, notebook or diagram, or multiple sheets of a drawing. It supports the STEP, SET, IGES, Medusa, DXF, CGM, TIFF, Stheno,and DWG formats. The interface file obtained using the function Pro2dExport() is controlled by one of its input argument data, an instance of the Pro2dExportdata object. Note that the data argument is optional; you do not have to specify it when exporting only the current sheet of the 2D model. Additionally, several Creo Parametric configuration options related to entity type export options can affect the results of the export operation. Refer to the Creo Parametric Online Help for details on the configuration options.
Example 1 Publishing a Drawing
The sample code in UgDwgPublishContext.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_dwg shows how to publish a drawing in the given context.
The functions Pro2dExportdataAlloc() and Pro2dExportdataFree() allocate and free the memory for the Pro2dExportdata object containing the 2D export options and flags.
The function Pro2dExportdataSheetoptionSet() assigns the sheet export option for export to the specified 2D format. The sheet export option can take one of the following values:
•  PRO2DEXPORT_CURRENT_TO_MODEL_SPACE—Specifies that only the drawing’s current sheet will be exported as model space into the specified 2D format. This is the default value.
•  PRO2DEXPORT_CURRENT_TO_PAPER_SPACE—Specifies that only the drawing’s current sheet will be exported as paper space into the specified 2D format. This value is only available for formats that support the concept of model space and paper space, for example, DXF and DWG.
•  PRO2DEXPORT_ALL—Specifies that all the sheets in a drawing will be exported into the specified 2D format as paper space, if applicable to the format type.
•  PRO2DEXPORT_SELECTED—Specifies that selected sheets in a drawing will be exported as paper space and one sheet will be exported as model space.
The function Pro2dExportdataSheetsSet() assigns the sheet numbers to be exported as paper space to the specified 2D export format file. Use this function only if the sheet export option is set to PRO2DEXPORT_SELECTED.
The function Pro2dExportdataModelspacesheetSet() assigns the sheet number to be exported as model space. Use this function only if the export format supports the concept of model space and paper space, and if the sheet export option is set to PRO2DEXPORT_SELECTED.
The functions ProProductviewexportoptsAlloc() and ProProductviewexportoptsFree() allocate and free the memory assigned to the ProProductviewExportOptions object containing the Creo View export formats.
The function ProProductviewexportoptsFormatSet() assigns the flag specifying the Creo View export format.
The function ProProductviewFormattedMdlnameExport() exports a drawing to one of the following user-defined Creo View formats:
•  PRO_PV_FORMAT_PVS
•  PRO_PV_FORMAT_ED
•  PRO_PV_FORMAT_EDZ
•  PRO_PV_FORMAT_PVZ
Use the function ProPrintPrinterOptionsGet() to get the options for a specified printer. Specify the printer type as the input argument for this function. The supported printer types are:
•  POSTSCRIPT—Generic Postscript
•  COLORPOSTSC—Color Postscript
•  MS_PRINT_MGR—MS Print Manager
Note
For a list of all supported printers, please refer to the Add Printer Type list in the Printer Configuration dialog box of Creo Parametric.
The function gets the initialized printer options. The options include the file related options, print command options and printer specific options as follows:
•  File Related:
  save_to_file—Saves a plot to a file.
  save_method—Specifies if the plot is to be appended to a file, saved to a single file, or saved to multiple files.
  filename—Specifies the name of the file to which the plot is saved.
  delete_after—Deletes the plot file after printing.
•  Print Command:
  send_to_printer—Sends the plot directly to the printer.
  print_command—Specifies the complete command that you want to use for printing.
  pen_table—Specifies the complete path to the file containing the pen table.
  paper_size—Specifies the size of the paper to be printed.
  quantity—Specifies the number of copies to be printed.
•  Printer Specific:
  sw_handshake—Specifies the type of the handshake initialization sequence. Specify the value as True to set the initialization sequence to Software and as False to set it to Hardware.
Note
Consult your system administrator for more information on handshaking.
  roll_media—Specifies whether to use roll-media or cut-sheet.
  use_ttf—Specifies whether to use TrueType font or stroked text.
  slew—Specifies the speed of the pen in centimeters per second in X and Y direction.
  rotate_plot—Specifies that the plot is to be rotated by 90 degrees.
Use the function ProPrintMdlOptionsGet() to get the initialized model options for the model to be printed. The available model options are:
•  mdl—Specifies the model to be printed.
•  quality—Determines the quality of the model to be printed. It checks for no line, no overlap, simple overlap, and complex overlap.
The model options specific to drawing objects are:
•  use_drawing_size—Overrides the size of the paper specified in the Printer options.
•  draw_format—Prints the drawing format used.
•  segmented—If true, that is the value is set to a boolean of 1, the printer prints drawing full size, but in segments that are compatible with the selected paper size. This option is available only if you are plotting a single page.
•  layer_only—Prints the specified layer only.
•  layer_name—Prints the name of the layer.
•  sheets—Prints the current sheet, all sheets, or selected sheets.
•  range—An array of two integers specifying the start and end sheet numbers.
The model option specific to solid objects is:
•  use_solid_scale—Prints using the scale used in the solid model.
Use the function ProPrintPlacementOptionsGet() to get the current print placement options such as print scale, offset, zoom, and so on. The options available for the object placement are:
•  Placement Options:
  scale—Specifies the scale used for the selected plot.
  offset—An array of two doubles representing the offset from the lower-left corner of the plot.
  keep_panzoom—Maintains the pan and zoom values of a window.
•  Clipping Options:
  clip_plot—Specifies whether you want to clip the plot.
  shift_to_ll_corner—Shifts the clip area to the lower-left corner of the plot
  clip_area—Two dimensional array of four double representing the area that is clipped. The range of the values of this option is 0.0 through 1.0.
•  Label Options:
  place_label—Specifies whether you want to place the label on the plot.
  label_height—Height of the label in inches.
Use the function ProPrintPCFOptionsGet() to get the print options from a specified Plotter Configuration File. Specify the name of the plotter configuration file and the name of the model to be printed. The function gets the printer options, model options and placement options.
Use the function ProPrintExecute() to print a Creo Parametric window using the specified printer options, model options and placement options. The drawing must be displayed in a window to be successfully printed.
Automatic Printing of 3D Models
Creo TOOLKIT provides the capability of automatically creating and plotting a drawing of a solid model. The Creo TOOLKIT application needs only to supply instructions for the print activity, and Creo Parametric will automatically create the drawing, print it, and then discard it.
The methods listed here are analogous to the command File  Print  Quick Drawing in Creo Parametric’s user interface.
Functions Introduced:
The function ProQuickprintoptionsAlloc() allocates a quick drawing options handle.
Use the function ProQuickprintoptionsFree() to free a quick drawing options handle.
Use the function ProQuickprintoptionsLayouttypeSet() to assign the layout type for the quick drawing operation. You can either specify a drawing layout using the instructions or use a template to define the drawing. The following are the available layout types:
•  PRO_QPRINT_LAYOUT_PROJ—Use a projected view-type layout.
•  PRO_QPRINT_LAYOUT_MANUAL—Use a manually arranged layout.
•  PRO_QPRINT_LAYOUT_TEMPLATE—Use a drawing template to define the layout. If this option is used, only the template name is needed to define the print; other options are not used.
Use the function ProQuickprintoptionsOrientationSet() to assign the sheet orientation for the quick drawing operation. The following are the available sheet orientation types:
•  PRODEV_ORIENTATION_PORTRAIT
•  PRODEV_ORIENTATION_LANDSCAPE
Use the function ProQuickprintoptionsSizeSet() to assign the size of the print for the quick drawing operation. ProPlotPaperSize specifies the paper size and can be any of the following types:
•  A_SIZE_PLOT
•  B_SIZE_PLOT
•  C_SIZE_PLOT
•  D_SIZE_PLOT
•  E_SIZE_PLOT
•  A4_SIZE_PLOT
•  A3_SIZE_PLOT
•  A2_SIZE_PLOT
•  A1_SIZE_PLOT
•  A0_SIZE_PLOT
•  F_SIZE_PLOT
Note
Variable size plots are not supported by this utility.
Use the function ProQuickprintoptionsViewAdd() to add a new general view. The input arguments of this function are:
•  options—Specifies the options handle.
•  location—Specifies the location of the view being added for projected view layout. This option is ignored for a manual view layout. It can be of the following types:
  PRO_QPRINTPROJ_GENVIEW_MAIN
  PRO_QPRINTPROJ_GENVIEW_NW
  PRO_QPRINTPROJ_GENVIEW_SW
  PRO_QPRINTPROJ_GENVIEW_SE
  PRO_QPRINTPROJ_GENVIEW_NE
The general view location options are analogous to the locations in the quick drawing user_interface:
Image
Note
For manual view layouts, the order in which the views are added determine their final location in the drawing. For this configuration, PTC does not support using more than four views.
•  view_name—Specifies the name of the saved model view.
•  scale—Specifies the view scale.
•  display_style—Specifies the view display style to use and is of the following types:
  PRO_DISPSTYLE_DEFAULT
  PRO_DISPSTYLE_WIREFRAME
  PRO_DISPSTYLE_HIDDEN_LINE
  PRO_DISPSTYLE_NO_HIDDEN
  PRO_DISPSTYLE_SHADED
  PRO_DISPSTYLE_FOLLOW_ENVIRONMENT
  PRO_DISPSTYLE_SHADED_WITH_EDGES
Use the function ProQuickprintoptionsThreeviewlayoutSet() to assign the layout type when three views are being used in a manual layout (PRO_QPRINT_LAYOUT_MANUAL). The layout can be either of the following types:
•  PRO_QPRINTMANUAL_3VIEW_1_23VERT
•  PRO_QPRINTMANUAL_3VIEW_23_VERT1
•  PRO_QPRINTMANUAL_3VIEW_123_HORIZ
These options correspond to the diagrams in the user interface:
Image
Use the function ProQuickprintoptionsProjectionsSet() assign the projected views to be included in the quick drawing operation. The function applies only to PRO_QPRINT_LAYOUT_PROJ. The projections are of the following types:
•  PRO_QPRINTPROJ_TOP_VIEW
•  PRO_QPRINTPROJ_RIGHT_VIEW
•  PRO_QPRINTPROJ_LEFT_VIEW
•  PRO_QPRINTPROJ_BOTTOM_VIEW
•  PRO_QPRINTPROJ_BACK_NORTH
•  PRO_QPRINTPROJ_BACK_EAST
•  PRO_QPRINTPROJ_BACK_SOUTH
•  PRO_QPRINTPROJ_BACK_WEST
Note
Projection views takes the same view scale and display style as the main view.
The options correspond to the projected members of the diagram in the user interface:
Image
Use the function ProQuickprintoptionsTemplateSet() to assign the path to the drawing template file to be used for the quick drawing operation. The function applies only to layout type PRO_QPRINT_LAYOUT_TEMPLATE.
Note
The quick drawing operation shows the exact image of the model as is shown on-screen. Therefore, if the drawing template has drawing views set with display options such as view clipping, simplified representations, or layers, these settings are ignored while plotting. The resulting plot reflects whatever is seen on-screen.
Use the function ProQuickprintoptionsPrintFlatToScreenAnnotsSet() to set the ProBoolean flag to print flat-to-screen annotations. The flat-to-screen annotations created at screen locations in the Creo Parametric graphics window are printed at their relative locations in the drawing. You can print flat-to-screen annotations such as notes, symbols, and surface finish symbols.
Once the instructions have been prepared, use the function ProQuickprintExecute() to execute a print operation for a given solid model. It has the following input arguments:
•  solid—Specifies the solid model to be printed.
•  pcf_path—Specifies the path to the plotter configuration file to use. If no path is specified, then the path will have the value of the configuration option quick_print_plotter_config_file.
•  options—Specifies the details of the quick drawing operation given by the ProQuickprintOptions handle.
Exporting 3D Models
Creo TOOLKIT provides export capabilities for three dimensional geometry to various formats.
Functions Introduced:
Export Format
Creo TOOLKIT Functions
Type Constant
STEP file (Standard for the Exchange of Product Model Data)
ProIntf3DFileWrite()
ProIntf3DFileWriteWithDefaultProfile()
PRO_INTF_EXPORT_STEP
VDA file
PRO_INTF_EXPORT_VDA
IGES (3D) file
PRO_INTF_EXPORT_IGES
CATIA (.model) file
PRO_INTF_EXPORT_CATIA_MODEL
SAT file (ACIS format for Creo Parametric)
PRO_INTF_EXPORT_SAT
NEUTRAL file (ASCII text)
PRO_INTF_EXPORT_NEUTRAL
CADDS file
PRO_INTF_EXPORT_CADDS
CATIA (.session) file
PRO_INTF_EXPORT_CATIA_SESSION
Parasolid file
PRO_INTF_EXPORT_PARASOLID
UG file
PRO_INTF_EXPORT_UG
CATIA V5 Part file
PRO_INTF_EXPORT_CATIA_PART
CATIA V5 Assembly file
PRO_INTF_EXPORT_CATIA_PRODUCT
JT Open format
PRO_INTF_EXPORT_JT
CATIA Graphical Representation (CGR) format
PRO_INTF_EXPORT_CATIA_CGR
DWG file
PRO_INTF_EXPORT_DWG
DXF file
PRO_INTF_EXPORT_DXF
SolidWorks Part File
PRO_INTF_EXPORT_SW_PART
SolidWorks Assembly File
PRO_INTF_EXPORT_SW_ASSEM
3D Manufacturing Format (3MF)
PRO_INTF_EXPORT_3MF
CATIA facets file
ProIntfSliceFileWithOptionsMdlnameExport()
PRO_CATIAFACETS_FILE
INVENTOR file
PRO_INVENTOR_FILE
Render file
PRO_RENDER_FILE
SLA ASCII file
PRO_SLA_ASCII_FILE
SLA Binary file
PRO_SLA_BINARY_FILE
Additive manufacturing file
PRO_AMF_FILE
JPEG file
ProRasterFileWrite()
PRORASTERTYPE_JPEG
BMP file
PRORASTERTYPE_BMP
TIFF file
PRORASTERTYPE_TIFF
EPS file (Postscript)
PRORASTERTYPE_EPS
PVS file, OL file
(a separate OL file is created for each PART in an assembly)
ProProductviewFormatted
Export()
PRO_PV_FORMAT_PVS
ED file, OL file
(a separate OL file is created for each PART in an assembly)
PRO_PV_FORMAT_ED
EDZ file
PRO_PV_FORMAT_EDZ
PVZ file
PRO_PV_FORMAT_PVZ
VRML
ProExportVRML()
N/A
Shrinkwrap
ProSolidShrinkwrap
Create()
N/A
The following data is included during the export of Creo Parametric models to other formats:
•  3D Manufacturing Format (3MF)—From Creo Parametric 5.0.1.0 onward, you can export Creo Parametric models to the 3MF format. The export includes part-level colors, top-assembly parameters, facet geometry, and hidden entities.
•  JT—Creo Parametric models are exported to JT with their color overrides. Components with color overrides at any level in an assembly structure are supported.
From Creo Parametric 3.0 onward, the Product Manufacturing Information (PMI) of the annotations is exported as semantic representation from Creo Parametric to JT models. The semantic export is supported only for 3D notes and basic dimensions. All the other types of annotations are exported as graphical entities. You can export planar and zonal cross-sections attached to combined states from Creo Parametric files to JT.
Note
From Creo Parametric 2.0 M200 onward the license INTF_for_JT is required to export a Creo Parametric model to JT. If the license is not available the functions return the error PRO_TK_NO_LICENSE.
•  Creo View—You can export colors assigned to the components of assemblies and their sub-assembly models, including the colors of the sub-level entities such as parts, quilts, and faces from Creo Parametric to Creo View.
Creo Parametric models are exported to Creo View with their color overrides. Components with color overrides at any level in an assembly structure are supported. Along with components, color overrides are also supported for component model items, such as, face and quilts.
•  SolidWorks—From Creo Parametric 3.0 onward, you can export Creo Parametric models to SolidWorks. The export includes basic geometry such as datum features, colors, attributes, and layers, part models, assembly structures, boundary representation geometry, and non-geometric data.
•  Unigraphics—The export of Creo Parametric models to Unigraphics includes the export of basic geometry such as datum features, colors, attributes, and layers.
Note
Refer to the Creo Parametric Data Exchange Help for more information on exporting geometry from Creo Parametric to other formats. Refer to the compatibility matrix on PTC.com for the supported software versions.
The following functions will be deprecated in a future release of Creo Parametric . Use the function ProIntf3DFileWriteWithDefaultProfile() instead to export Creo Parametric models to other file formats. All the options that can be set with these functions, can also be set using the export profile option in Creo Parametric. Refer to the Creo Parametric Data Exchange Online Help for more information.
•  ProIntf3DFileWrite()
•  ProOutputInclusionAlloc()
•  ProOutputInclusionFree()
•  ProOutputInclusionFlagsSet()
•  ProOutputLayerOptionsAlloc()
•  ProOutputLayerOptionsAutoidSet()
•  ProOutputLayerOptionsSetupfileSet()
•  ProOutputLayerOptionsFree()
•  ProOutputInclusionWithOptionsSet()
The function ProIntf3DFileWriteWithDefaultProfile() exports a Creo Parametric model to the specified output format using the default export profile.
The function ProIntf3DFileWrite() will be deprecated in a future release of Creo Parametric. Use the function ProIntf3DFileWriteWithDefaultProfile() instead. The function ProIntf3DFileWrite() exports a Creo Parametric model to the specified output format. The following types of output formats are supported:
•  STEP
•  VDA
•  IGES
•  CATIA MODEL
•  SAT (ACIS format in Creo Parametric)
•  NEUTRAL
•  CADDS
•  CATIA SESSION
•  PARASOLID
•  UG
•  CATIA V5
•  JT Open
•  CATIA Graphical Representation
•  DWG
•  DXF
While exporting the model, you can specify the structure and contents of the output files as:
•  Flat File—Exports all of the geometry of the assembly to a single file as if it were a part. This is similar to the Single File format in Creo Parametric for STEP output.
•  Single File—Exports an assembly structure to a file with external references to component files. This file contains only top-level geometry. This is similar to the Dittos format in Creo Parametric for CATIA, Separate Parts Only for STEP and One Level for IGES outputs. A part or an assembly is exported as a single file for the DXF and the DWG formats.
•  Multi Files—Exports an assembly structure to a single file and the components to component files. It creates component parts and subassemblies with their respective geometry and external references. This option supports all levels of hierarchy. This is similar to All Levels format for IGES and Separate All Parts for STEP in Creo Parametric.
•  Parts—Exports an assembly as multiple files containing geometry information of its components and assembly features. This is similar to All Parts format for IGES in Creo Parametric.
Some output formats support only certain types of assembly configurations. The default assembly configuration is a flat file.
Note
Using the Creo TOOLKIT function ProIntf3DFileWrite() you can export a Creo Parametric 3D model to a JT file format.
From Creo Parametric 2.0 M200 onward, the function ProIntf3DFileWrite() exports a Creo Parametric 3D model to JT file format only if the license INTF_for_JT is available. If the license is not available the function returns the error PRO_TK_NO_LICENSE.
Starting with Creo Parametric1.0, XT-brep data format is supported along with the JT-brep format for storing the 3D model data to export. Use the new configuration option intf3d_ out_jt_brep to export the Creo Parametric model using the function ProIntf3DFileWrite(). This configuration option takes the following values:
•  NO—This is the default value. When you set the configuration option intf3d_out_jt_brep as NO, the function ProIntf3DFileWrite() exports the Creo Parametric model to JT format as facet representation only.
•  JT_BREP—When you set the configuration option intf3d_out_jt_brep to JT_BREP, the exported Creo Parametric model has both the JT-brep format and the faceted representation.
•  XT_BREP—When you set the configuration option intf3d_out_jt_brep to XT_BREP, the exported Creo Parametric model has both the XT-brep format and the faceted representation.
•  The export of a Creo Parametric 3D model to a JT file format using the function ProIntf3DFileWrite() is also impacted by the following configuration options:
  intf3d_out_jt_auto_lods—It takes the values yes or no*. If you set the configuration option intf3d_out_jt_auto_lods to yes, you can export up to three Levels of Detail (LODs) to the JT format.
  intf3d_out_jt_config_name—Name of the JT configuration file. You can define a configuration file jt.config. You can define parameters and export options in this file. You can also control the export of the LODs to the JT format via Creo TOOLKIT using this file. The options set in this file override the setting of the configuration option intf3d_out_jt_auto_lods. Refer to the section Export Options in the JT Configuration File for more information about the options that can be set in the jt.config file.
  intf3d_out_jt_config_path—Path of the JT configuration file.
•  The configuration option intf3d_out_export_as_facets is now obsolete.
The function ProIntf3DLayerSetupFileSet() sets the layer setup file for the export. The input arguments follow:
•  model—The model used for export.
•  layer_setup_file—The full path of the input layer setup file. Pass the value as NULL to set default layer setup settings for input file_type. Layer setup file is not supported for PRO_INTF_EXPORT_CADDS and PRO_INTF_EXPORT_NEUTRAL file types.
For more information about how to use and save a layer setup file in the Creo Parametric user interface, refer to the section About Using Layer Status Files and its corresponding topics in the Creo Parametric Online Help.
The function ProIntf3DLayerSetupFileIsIgnored() checks if layer setup file is ignored or not during export. This function returns if the layer setup file is used for the last export, using the function ProIntf3DFileWriteWithDefaultProfile().
For reliable results, call the function ProIntf3DFileWriteWithDefaultProfile() before calling ProIntf3DLayerSetupFileIsIgnored().
The output argument is_ignored returns PRO_B_TRUE if the layer setup file is ignored and returns PRO_B_FALSE if layer setup file is not ignored.
The function ProIntf3DCsysSet() sets the reference coordinate system Csys for the export. The input arguments follow:
•  pro_model—The model used for export.
•  csys_sel—The reference coordinate system. Pass the value as NULL to set default coordinate system. Reference Csys is not supported for PRO_INTF_EXPORT_CADDS and PRO_INTF_EXPORT_NEUTRAL file types.
The function ProIntf3DCsysIsIgnored() checks if the reference coordinate system is ignored or not during export. The function returns if the reference Csys is used for the last export, using the function ProIntf3DFileWriteWithDefaultProfile().
For reliable results, call the function ProIntf3DFileWriteWithDefaultProfile() before calling ProIntf3DLayerSetupFileIsIgnored().
The output argument is_ignored returns PRO_B_TRUE if the reference Csys is ignored and returns PRO_B_FALSE if the reference Csys is not ignored.
The function ProIntf3DModelDataClear() clears the model data set by the functions ProIntf3DLayerSetupFileSet() and ProIntf3DCsysSet().
Use the function ProOutputAssemblyConfigurationIsSupported() to check if the specified assembly configuration is valid for the particular model and the specified export format. This function must be called before exporting the model to the specified output format using the function ProIntf3DFileWrite() except for the CADDS and STEP2D formats.
The function ProOutputBrepRepresentationAlloc() allocates memory for the geometric representation data structure. This data structure represents the types of geometry supported by the export operation. The types of geometric representations are:
•  Wireframe
•  Surfaces
•  Solid
•  Quilts (Shell in Creo Parametric)
These correspond to the options shown in the Creo Parametric dialog box for export. Note that some formats allow a combination of types to be input.
The function ProOutputBrepRepresentationFlagsSet() sets the flags for the geometric representation data structure. It specifies the type of geometry to be exported.
The function ProIntfExportProfileLoad() loads the specified profile for export. You can use this function when you want to use the export profile of your choice instead of the default export profile in a particular Creo Parametric session. The input argument profile is the full path to the profile along with the profile name and extension.
Note
Once the export profile file is loaded in a Creo Parametric session, it will be active in the interactive mode as well.
The function ProOutputBrepRepresentationIsSupported() checks if the specified geometric representation is valid for a particular export format. This function should be called before exporting the model to the specified output format using the function ProIntf3DFileWrite(), to check if the planned configuration is supported by the Creo Parametric interface options.
The function ProOutputBrepRepresentationFree() frees the memory allocated for the geometry data structure.
The function ProOutputInclusionAlloc() will be deprecated in a future release of Creo Parametric. The function ProOutputInclusionAlloc() allocates memory for the inclusion structure to be used while exporting the model.
The function ProOutputInclusionFlagsSet() will be deprecated in a future release of Creo Parametric. It is recommended that you set this option in export profile file in Creo Parametric. The function ProOutputInclusionFlagsSet() determines whether to include certain entities during export. The types of entities are:
•  Datums—Determines whether datum curves are included when exporting files. If the flag is set to true the datum curve and point information is included during export. The default value is false.
•  Blanked—Determines whether entities on blanked layers are exported. If the flag is set to true, entities on blanked layers are exported. The default value is false.
•  Facets—Determines whether faceted geometry is included when exporting the models. The default value of the flag is false.
The function ProOutputInclusionFacetparamsSet() assigns the parameters to use while exporting the model to a faceted format such as PRO_INTF_EXPORT_CATIA_CGR. These parameters are as follows:
•  chord_height—The chord height to use for the exported facets.
•  angle_control—The angle control to use for the exported facets.
Note
The function ProOutputInclusionFacetparamsSet() has been deprecated. Use the function ProOutputInclusionWithOptionsSet() instead.
The function ProOutputInclusionWithOptionsSet() will be deprecated in a future release of Creo Parametric. It is recommended that you set this option in export profile file in Creo Parametric. Use the function ProOutputInclusionWithOptionsSet() to set the parameters and configuration flags used while exporting the model to a faceted format such as PRO_INTF_EXPORT_CATIA_CGR. The input arguments are as follows:
•  parameters—Specifies a ProArray of parameters that consists of the following three elements:
  chord_height—The chord height of the exported facets.
  angle_control—The angle control of the exported facets. Specify a value between 0.0 to 1.0. If the angle control is out of bounds, Creo Parametric changes it to the closest limit without returning an error.
  step_size—The step size of the exported facets. If the step size is less or equal to 0, it is ignored.
Note
If the chord height or step size are too small or too big, then Creo Parametric resets it to the smallest or biggest acceptable value, respectively, without returning an error.
•  config_flags—Specifies the configuration flags that control the export operation. They are as follows:
  PRO_FACET_STEP_SIZE_OFF—Switches off the step size control.
  PRO_FACET_FORCE_INTO_RANGE—Forces the out-of-range parameters into range. If any of the PRO_FACET_*_DEFAULT option is set, then the option PRO_FACET_FORCE_INTO_RANGE is not applied on that parameter.
  PRO_FACET_STEP_SIZE_ADJUST—Adjusts the step size according to the component size.
  PRO_FACET_CHORD_HEIGHT_ADJUST—Adjusts the chord height according to the component size.
  PRO_FACET_USE_CONFIG—If this flag is set, values of the flags PRO_FACET_STEP_SIZE_OFF, PRO_FACET_STEP_SIZE_ADJUST, and PRO_FACET_CHORD_HEIGHT_ADJUST are ignored and the configuration settings from the Creo Parametric user interface are used during the export operation
  PRO_FACET_CHORD_HEIGHT_DEFAULT—Uses the default value set in the Creo Parametric user interface for the chord height.
  PRO_FACET_ANGLE_CONTROL_DEFAULT—Uses the default value set in the Creo Parametric user interface for the angle control.
  PRO_FACET_STEP_SIZE_DEFAULT—Uses the default value set in the Creo Parametric user interface for the step size.
  PRO_FACET_INCLUDE_QUILTS—Includes quilts in the export of Creo Parametric model to the specified format.
  PRO_EXPORT_INCLUDE_ANNOTATIONS—Includes annotations in the export of Creo Parametric model to the specified format.
Note
To include annotations, during the export of Creo Parametric model, you must call the function ProMdlDisplay() before calling ProIntf3DFileWrite().
  PRO_FACET_VISIBLE_MODELS—Exports models which have their visibility status set to Show in Creo Parametric. Models that are hidden are not exported.
Note
The behavior of the function ProOutputInclusionWithOptionsSet() is similar to the function ProOutputInclusionFacetparamsSet() if the configuration flag PRO_FACET_STEP_SIZE_OFF is set.
The function ProOutputInclusionFree() will be deprecated in a future release of Creo Parametric. The function ProOutputInclusionFree() frees the memory allocated for the inclusion structure.
The function ProOutputLayerOptionsAlloc() will be deprecated in a future release of Creo Parametric. The function ProOutputLayerOptionsAlloc() allocates memory for the layer options data structure. The layer options are:
•  AutoId—A flag indicating whether layers should be automatically assigned numerical ids when exporting.
•  LayerSetupFile—The layer setup file contains the name of the layer, its display status, the interface ID and number of sub layers.
Specify the name and complete path of the layer setup file. This file contains the layer assignment information.
The function ProOutputLayerOptionsAutoidSet() will be deprecated in a future release of Creo Parametric. It is recommended that you set this option in export profile file in Creo Parametric. The function ProOutputLayerOptionsAutoidSet() enables you to set or remove an interface layer ID. If true, automatically assigns interface ids to layers not assigned ids and exports them. The default value is false.
The function ProOutputLayerOptionsSetupfileSet() will be deprecated in a future release of Creo Parametric. It is recommended that you set this option in export profile file in Creo Parametric. Use the function ProOutputLayerOptionsSetupfileSet() to specify the name and complete path of the layer setup file.
The function ProOutputLayerOptionsFree() will be deprecated in a future release of Creo Parametric. The function ProOutputLayerOptionsFree() frees the memory allocated for the layer options structure.
Use function ProRasterFileWrite() to create a standard Creo Parametric raster output file. Note that this function does not support output of drawings (2-dimensional objects) in Drawing mode.
The PRO_SPOOL_FILE option reads in a Diagram spool file.
The function ProIntfSliceFileWithOptionsMdlnameExport() exports to tesellated formats such as STL, Render, AMF, Inventor, CatiaFacets, 3MF, and Optegra Visualizer based on the values of a ProArray of parameters and two configuration flags. These formats require the maximum chord height, angle control, and transformation to be specified for the model being exported. If the specified model is an assembly, the last input argument of the function is the component path; if the model is a part, this argument is NULL. These parameters and configuration flags are same as the ones assigned by the function ProOutputInclusionWithOptionsSet() described earlier in this section. Refer to its description for more information on the parameters and configuration flags.
The function ProExportVRML() exports a solid from a Creo Parametric session, or a Creo Parametric solid stored in a file, into a directory of VRML files. This output directory contains assembly structure data, part and assembly names, and geometrical data representing the parts. This function accepts as input only Creo Parametric assemblies or parts.
ProExportVRML() supports creation of multiple output files from either parts or assemblies. If you export an assembly, the function creates an output file for each member of the assembly and one for the assembly itself. Default file names are:
asm1_a.wrl, asm2_a.wrl, ... asmN_a.wrl
where asm is the assembly name.
If you export parts, ProExportVRML() creates an output file for each part. Default names are part_p.wrl, where part is the part name. For more information on ProExportVRML(), refer to “Exporting Files to VRML” or “Batch Utilities” in the “Interface” section of Creo Parametric help.
The functions ProProductviewexportoptsAlloc() and ProProductviewexportoptsFree() allocate and free the memory assigned to the ProProductviewExportOptions object containing the Creo View export formats.
The function ProProductviewexportoptsFormatSet() assigns the flag specifying the Creo View export format.
The function ProProductviewFormattedMdlnameExport() exports a part or an assembly to one of the following user-defined Creo View formats.
•  PRO_PV_FORMAT_PVS
•  PRO_PV_FORMAT_ED
•  PRO_PV_FORMAT_EDZ
•  PRO_PV_FORMAT_PVZ
Example 2: To Export a Model File to IGES Format
The sample code in UgInterfaceExport.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_interface shows how to export a model file to IGES format using options similar to those seen in the UI.
Export Options in the JT Configuration File
You can export up to three levels of detail (LODs) from Creo Parametric files to the JT format. An LOD is a graphical representation of details such as the chord height, angle control, and step size for faceted surfaces. Each faceted surface is made up of a specific number of triangles. These shaded triangles represent the object. The more triangles that describe the object, the more details you can view.
You can create and use a configuration file, jt.config, to control the export of the LODs from Creo Parametric files to the JT format. The jt.config file is located in the <creo_loadpoint>\<version>\Common Files\text\jt\ directory. The options set in this file override the configuration options in the config.pro configuration file.
You can include the following parameters or export options in the jt.config file:
•  EAITranslator—Specifies the setting for the export of control parameters.
  chordalOption—Specifies whether to apply the chordal value as an absolute value in model units or as a relative value that is a percentage of the part size. The valid values are:
  RELATIVE—Tessellates all the parts in a model relative to their size equally. The chordal value is applied as a fractional percentage.
  ABSOLUTE—Tessellates all the parts in a model regardless of their size. The chordal value is applied as an absolute value.
  structureOption—Specifies the mapping of the JT product structure to the JT file structure in the JT files after export. The supported product structures are:
  JtkPER_PART—Specifies that the assembly is exported as a single JT file. The parts in the assembly are exported and saved as individual JT files in a sub-directory of the same name as the top-level assembly file.
  JtkFULL_SHATTER—Specifies that each component of the assembly is exported as a separate JT file.
  JtkMONOLITHIC—Specifies that the assembly is exported as a single JT file.
  writeWhichFiles—Specifies which components must be exported to JT format.
  ALL—This is the default option. Specifies that the entire assembly along with its parts must be exported.
  ASSEMBLY_ONLY—Specifies that only the product structure must be exported.
  PARTS_ONLY—Specifies that only the parts in the assembly must be exported without the assembly structure.
  JtFileFormat—Specifies the version of the JT format in which the files must be exported. Refer to the Creo Parametric Data Exchange Help, for more information on AUTO option.
  includeBrep—Specifies a boolean value to include the geometry boundary representation definition, that is, JT-brep or XT-brep, in the files exported to JT format. It controls the export of annotations as semantic representations. You cannot include the JT-brep and the XT-brep data structures in the same file. The valid values are true or false.
  autoXtBrep—Specifies a boolean value to automatically convert the boundary representation geometry to parasolid format during the export. When you set the option to true, the boundary representation data is converted to the parasolid format. When set to false, the boundary representation data is stored in the proprietary JT format.
You can use the autoXtBrep option with the includeBrep option to switch between the JT-brep and the XT-brep structures.
  numLODs—Specifies the number of LOD definitions. PTC recommends creating up to three LODs.
•  LOD—Specifies a group of parameters that control tessellation for a specific LOD. It also specifies the number of the current LOD.
  Level—Specifies the current LOD number.
  Chordal—Specifies the maximum distance that a tessellated line segment deviates from the actual curve it approximates. It takes the value as a floating number from [0.0,1.0]. The value specified is as determined by the chordalOption option. If the chordal value exceeds the model size, you can consider the model size as the chordal value.
Note
For best results, use chordal values in conjunction with the Angular parameter. Chordal values primarily affect the larger features of the model while the angular values affect the smaller features of the model.
  Length—Specifies the maximum absolute length of the tessellated line segments in a curve approximation. If the Length value exceeds the model size, consider the default value as (model_size/30).
  Label—Specifies the user-defined name for the LOD.
  Angular—Specifies the angle control value for LOD definitions and triangulation export to JT format. This parameter sets the absolute maximum angle between two adjacent line segments in a curve approximation. The angle has its value between 0 and 90 degrees. The maximum angle value indicates coarse tessellation while the lowest value indicates fine tessellation and high quality LOD.
•  proeConfig—Specifies the options that are specific to Creo Parametric.
  autoLODgeneration—Specifies a boolean value to automatically generate three LODs from Creo Parametric. The valid values are true or false.
Note
When autoLODgeneration is set to true, the LOD options set in the jt.config file are ignored.
  autoLODStepSize—Specifies a boolean value to use the step size parameter during the automatic generation of LODs using the options set in Creo Parametric. This option is available only when autoLODgeneration is set to true.
Note
When autoLODStepSize is set to true, the step size set in the jt.config file is ignored.
  LOD[n]angle—Regulates the amount of additional improvement along curves with small radii for LOD1, LOD2, and LOD3. It takes the value as a floating number from [0.0,1.0]. This option is available only when autoLODgeneration is set to false.
•  UseJTAngularControl—Specifies the type of angle control to be used. Angles can be controlled using the Creo Parametric angle control values or the JT angle control values. Set this parameter to true to use the JT angle control values. Specify the angle control values in the Angular option.
By default, this parameter is set to false. In this case, the Creo Parametric angle control options, LOD1angle, LOD2angle, LOD3angle, and so on, are used to define the LOD generation.
You must set the configuration options intf3d_out_jt_config_name and intf3d_out_jt_config_path to specify the name and location of the jt.config file.
Shrinkwrap Export
To improve performance in large assembly design, you can export lightweight representations of models called Shrinkwrap models. A shrinkwrap model is based on the external surfaces of the source part or assembly model and captures the outer shape of the source model.
You can create the following types of non associative exported Shrinkwrap models:
•  Surface Subset—This type consists of a subset of the original model’s surfaces.
•  Faceted Solid—This type is a faceted solid representing the original solid.
•  Merged Solid—The external components from the reference assembly model are merged into a single part representing the solid geometry in all collected components.
Export Format
Creo TOOLKIT Functions
Type Constant
Shrinkwrap
ProSolidShrinkwrap
Create()
N/A
Function Introduced:
You can export the specified solid model as a Shrinkwrap model using the function ProSolidShrinkwrapMdlnameCreate(). This function requires:
•  The model to be exported as Shrinkwrap
•  The template model where the Shrinkwrap geometry will be created.
•  The name of the exported file if the export format is VRML or STL.
Setting Shrinkwrap Options
Functions Introduced:
The function ProShrinkwrapoptionsAlloc() allocates memory for the structure defining the shrinkwrap options. The types of shrinkwrap methods are:
•  PRO_SWCREATE_SURF_SUBSET—Surface Subset
•  PRO_SWCREATE_FACETED_SOLID—Faceted Solid
•  PRO_SWCREATE_MERGED_SOLID—Merged Solid
The function returns the options handle which is used to set the members of the structure defining the shrinkwrap options.
The function ProShrinkwrapoptionsFree() frees the memory allocated by the function ProShrinkwrapoptionsAlloc().
The function ProShrinkwrapoptionsQualitySet() specifies the quality level for the system to use when identifying surfaces or components that will contribute to the Shrinkwrap model. Quality ranges from 1 which produces the coarsest representation of the model in the fastest time, to 10 which produces the most exact representation. The default value is true.
The function ProShrinkwrapoptionsAutoholefillingSet() sets a flag that forces Creo Parametric to identify all holes and surfaces that intersect a single surface and fills those holes during shrinkwrap. The default value is true.
The function ProShrinkwrapoptionsIgnoreskeletonsSet() determines whether the skeleton model geometry must be included in the Shrinkwrap model.
ProShrinkwrapoptionsIgnorequiltsSet() determines whether external quilts will be included in the Shrinkwrap model.
ProShrinkwrapoptionsIgnoreconstrbodiesSet() determines whether construction bodies are included in the Shrinkwrap model.
ProShrinkwrapoptionsAssignmasspropsSet() assigns mass properties to the Shrinkwrap model. The default value is false and the mass properties of the original model is assigned to the Shrinkwrap model. If the value is set to true, the user will have to assign a value for the mass properties.
ProShrinkwrapoptionsDatumrefsSet() selects the datum planes, points, curves, axes, and coordinate system references to be included from the Shrinkwrap model.
Surface Subset Options
Functions Introduced:
The function ProShrinkwrapoptionsIgnoresmallsurfsSet() sets a flag that forces Creo Parametric to skip surfaces smaller than a certain size. The default value of this argument is false. The size of the surface is specified as a percentage of the model’s size.
Use ProShrinkwrapoptionsAdditionalsurfacesSet() to select individual surfaces to be included in the Shrinkwrap model.
Faceted Solid Options
Functions Introduced:
Use the function ProShrinkwrapoptionsFacetedformatSet() to specify the output file format of the Shrinkwrap model. The types of output format are:
•  PRO_SWFACETED_PART——Creo Parametric part with normal geometry. This is the default format type.
•  PRO_SWFACETED_LIGHTWEIGHT_PART—Lightweight Creo Parametric part with lightweight, faceted geometry.
•  PRO_SWFACETED_STL—An STL file
•  PRO_SWFACETED_VRML—A VRML file
The function ProShrinkwrapoptionsFramesFileSet() enables you to select a frame file to create a faceted solid motion envelope model that represents the full motion of the mechanism captured in the frame file. Specify the name and complete path of the frame file.
Merged Solid Options
Function Introduced:
Use the function ProShrinkwrapoptionsAdditionalcomponentsSet() to select individual components of the assembly to be merged into the Shrinkwrap model.
Example 3: To Export a Model to VRML Format
The sample code in UgInterfaceExport.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_interface shows how to create a faceted shrinkwrap model in VRML format
Example 4: To Create a Shrinkwrap Part Model as a Merged Solid
The sample code in UgInterfaceExport.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_interface shows how to create a new empty model and copy the merged solid shrinkwrap information into it.
Exporting to PDF and U3D
The functions described in this section support the export of Creo Parametric drawings and solid models to Portable Document Format (PDF) and U3D format. You can export a drawing or a 2D model as a 2D raster image embedded in a PDF file. You can export Creo Parametric solid models in the following ways:
•  As a U3D model embedded in a one-page PDF file
•  As 2D raster images embedded in the pages of a PDF file representing saved views
•  As a standalone U3D file
While exporting multiple sheets of a Creo Parametric drawing to a PDF file, you can choose to export all sheets, the current sheet, or selected sheets.
These functions also allow you to insert a variety of non-geometric information to improve document content, navigation, and search.
Functions Introduced:
The function ProPDFoptionsAlloc() allocates memory for the PDF options structure.
The function ProPDFoptionsIntpropertySet() sets the value for an integer or enum property of the PDF options structure. The types of export options are as follows:
•  PRO_PDFOPT_EXPORT_MODE—Enables you to select the object to be exported to PDF and the export format. The values are:
  PRO_PDF_2D_DRAWING—Specifies that only 2D drawings will be exported to PDF. This is the default.
  PRO_PDF_3D_AS_NAMED_VIEWS—Specifies that Creo Parametric models will be exported as 2D raster images embedded in PDF files.
  PRO_PDF_3D_AS_U3D_PDF—Specifies that Creo Parametric models will be exported as U3D models embedded in one-page PDF files.
  PRO_PDF_3D_AS_U3D—Specifies that a Creo Parametric model will be exported as a U3D (*.u3d) file. This value ignores the options available for the PDF options structure.
•  PRO_PDFOPT_PDF_SAVE—Enables you to specify the PDF format while exporting 2D drawings and solid models. The values are:
  PRO_PDF_ARCHIVE_1—Exports the 2D drawing to the PDF/A format. This type is applicable only for 2D drawings, that is, when you set the option PRO_PDFOPT_EXPORT_MODE to PRO_PDF_2D_DRAWING.
If you set the option PRO_PDFOPT_PDF_SAVE to PRO_PDF_ARCHIVE_1, the following options are set as shown below:
  PRO_PDFOPT_LAYER_MODE is set to PRO_PDF_LAYERS_NONE.
  PRO_PDFOPT_HYPERLINKS is set to FALSE, that is, hyperlinks are not created in the PDF.
  Shaded views will not be transparent and may overlap other data.
  PRO_PDFOPT_PASSWORD_TO_OPEN is set to NULL.
  PRO_PDFOPT_MASTER_PASSWORD is set to NULL.
  PRO_PDF_FULL—Exports the object to the standard PDF format. This is the default value.
•  PRO_PDFOPT_FONT_STROKE—Enables you to switch between using TrueType fonts in the resulting document and drawing or "stroking" text as line segments. The values are:
  PRO_PDF_USE_TRUE_TYPE_FONTS—Specifies TrueType fonts. This is the default.
  PRO_PDF_STROKE_ALL_FONTS—Specifies the option to stroke all fonts.
•  PRO_PDFOPT_COLOR_DEPTH—Enables you to choose between color, grayscale, or monochrome output. The values are:
  PRO_PDF_CD_COLOR—Specifies color output. This is the default.
  PRO_PDF_CD_GRAY—Specifies grayscale output.
  PRO_PDF_CD_MONO—Specifies monochrome output.
•  PRO_PDFOPT_HIDDENLINE_MODE—Enables you to set the style for hidden lines in the resulting PDF document. The values are:
  PRO_PDF_HLM_DASHED—Specifies dashed hidden lines. This is the default.
  PRO_PDF_HLM_SOLID—Specifies solid hidden lines.
•  PRO_PDFOPT_RASTER_DPI—Enables you to set the resolution for the output of any shaded views in DPI. The value is restricted to the values in ProDotsPerInch, and the default is PRORASTERDPI_300.
•  PRO_PDFOPT_LAYER_MODE—Enables you to set the availability of layers in the document. The values are:
  PRO_PDF_LAYERS_VISIBLE—Exports only visible layers in a drawing.
  PRO_PDF_LAYERS_NONE—Exports only the visible entities in the drawing, but not the layers on which they are placed.
  PRO_PDF_LAYERS_ALL—Exports the visible layers and entities. This is the default.
•  PRO_PDFOPT_PARAM_MODE—Enables you to set the availability of model parameters as searchable metadata in the PDF document. The values are:
  PRO_PDF_PARAMS_DESIGNATED—Exports only the specified model parameters in the PDF metadata.
  PRO_PDF_PARAMS_NONE—Exports the drawing to PDF without the model parameters.
  PRO_PDF_PARAMS_ALL—Exports the drawing and the model parameters to PDF. This is the default.
•  PRO_PDFOPT_ALLOW_MODE—Defines the changes that you can make in the PDF document. This option can be set only if PRO_PDFOPT_RESTRICT_OPERATIONS is set to true. The permitted viewer operations are given by the following values:
  PRO_PDF_RESTRICT_NONE—This is the default value and it restricts you from performing all operations in the PDF document.
  PRO_PDF_RESTRICT_FORMS_SIGNING—Allows you to fill in the fields of the form, create templates, and add digital signatures to the PDF document.
  PRO_PDF_RESTRICT_INSERT_DELETE_ROTATE—Allows you to insert, delete, and rotate pages in the PDF document.
  PRO_PDF_RESTRICT_COMMENT_FORM_SIGNING—Allows you to add or edit comments, fill in the fields of the form, create templates, and add digital signatures to the PDF document.
  PRO_PDF_RESTRICT_EXTRACTING—Allows you to perform all viewer operations, except for extracting pages from the PDF document.
•  PRO_PDFOPT_ALLOW_PRINTING_MODE—Allows you to set the print resolution. This option can be set only if the options PRO_PDFOPT_RESTRICT_OPERATIONS and PRO_PDFOPT_ALLOW_PRINTING are set to true. The values are:
  PRO_PDF_PRINTING_LOW_RES—Specifies low resolution for printing.
  PRO_PDF_PRINTING_HIGH_RES—Specifies high resolution for printing. This is the default.
•  PRO_PDFOPT_LINECAP—Enables you to control the treatment of the ends of the geometry lines exported to PDF. The values are:
  PRO_PDF_LINECAP_BUTT—Specifies the butt cap square end. This is the default.
  PRO_PDF_LINECAP_ROUND—Specifies the round cap end.
  PRO_PDF_LINECAP_PROJECTING_SQUARE—Specifies the projecting square cap end.
•  PRO_PDFOPT_LINEJOIN—Enables you to control the treatment of the joined corners of connected lines exported to PDF. The values are:
  PRO_PDF_LINEJOIN_MITER—Specifies the miter join. This is the default.
  PRO_PDF_LINEJOIN_ROUND—Specifies the round join.
  PRO_PDF_LINEJOIN_BEVEL—Specifies the bevel join.
•  PRO_PDFOPT_SHEETS—Enables you to specify the sheets from a Creo Parametric drawing that are to be exported to PDF. The values are:
  PRINT_CURRENT_SHEET—Specifies that only the current sheet will be exported to the PDF file.
  PRINT_ALL_SHEETS—Specifies that all the sheets will be exported to the PDF file. This is the default.
  PRINT_SELECTED_SHEETS—Specifies that sheets of a specified range will be exported to the PDF file. If this value is assigned, then the value of the string property PRO_PDFOPT_SHEET_RANGE must also be included.
•  PRO_PDFOPT_LIGHT_DEFAULT—Enables you to set the default lighting style used while exporting Creo Parametric models in the U3D format to a one-page PDF file. The values are:
  PRO_PDF_U3D_LIGHT_NONE—Specifies no lights.
  PRO_PDF_U3D_LIGHT_WHITE—Specifies white lights.
  PRO_PDF_U3D_LIGHT_DAY—Specifies day lights.
  PRO_PDF_U3D_LIGHT_BRIGHT— Specifies bright lights.
  PRO_PDF_U3D_LIGHT_PRIMARY—Specifies primary color lights.
  PRO_PDF_U3D_LIGHT_NIGHT—Specifies night lights.
  PRO_PDF_U3D_LIGHT_BLUE—Specifies blue lights.
  PRO_PDF_U3D_LIGHT_RED—Specifies red lights.
  PRO_PDF_U3D_LIGHT_CUBE—Specifies cube lights.
  PRO_PDF_U3D_LIGHT_CAD—Specifies CAD optimized lights. This is the default value.
  PRO_PDF_U3D_LIGHT_HEADLAMP—Specifies headlamp lights.
•  PRO_PDFOPT_RENDER_STYLE_DEFAULT—Enables you to set the default rendering style used while exporting Creo Parametric models in the U3D format to a one-page PDF file. The values are:
  PRO_PDF_U3D_RENDER_BOUNDING_BOX—Specifies bounding box rendering.
  PRO_PDF_U3D_RENDER_TRANSPARENT_BOUNDING_BOX—Specifies transparent bounding box rendering.
  PRO_PDF_U3D_RENDER_TRANSPARENT_BOUNDING_BOX_OUTLINE—Specifies transparent bounding box outline rendering.
  PRO_PDF_U3D_RENDER_VERTICES—Specifies vertices rendering.
  PRO_PDF_U3D_RENDER_SHADED_VERTICES—Specifies shaded vertices rendering.
  PRO_PDF_U3D_RENDER_WIREFRAME—Specifies wireframe rendering.
  PRO_PDF_U3D_RENDER_SHADED_WIREFRAME—Specifies shaded wireframe rendering.
  PRO_PDF_U3D_RENDER_SOLID—Specifies solid rendering. This is the default.
  PRO_PDF_U3D_RENDER_TRANSPARENT—Specifies transparent rendering.
  PRO_PDF_U3D_RENDER_SOLID_WIREFRAME—Specifies solid wireframe rendering.
  PRO_PDF_U3D_RENDER_TRANSPARENT_WIREFRAME—Specifies transparent wireframe rendering.
  PRO_PDF_U3D_RENDER_ILLUSTRATION—Specifies illustrated rendering.
  PRO_PDF_U3D_RENDER_SOLID_OUTLINE—Specifies solid outlined rendering.
  PRO_PDF_U3D_RENDER_SHADED_ILLUSTRATION—Specifies shaded illustrated rendering.
  PRO_PDF_U3D_RENDER_HIDDEN_WIREFRAME—Specifies hidden wireframe rendering.
•  PRO_PDFOPT_SIZE—Enables you to specify the page size of the exported PDF file. The values are restricted to the value of ProPlotPaperSize. If the value is VARIABLE_SIZE_IN_MM_PLOT or VARIABLE_SIZE_PLOT, the size must be specified in the PRO_PDFOPT_HEIGHT and PRO_PDFOPT_WIDTH properties.
•  PRO_PDFOPT_ORIENTATION—Enables you to specify the orientation of the pages in the exported PDF file. The values are:
  PRO_ORIENTATION_PORTRAIT—Exports the pages in portrait orientation. This is the default.
  PRO_ORIENTATION_LANDSCAPE—Exports the pages in landscape orientation.
The option PRO_PDFOPT_ORIENTATION is not available if the property PRO_PDFOPT_SIZE is set to VARIABLE_SIZE_IN_MM_PLOT or VARIABLE_SIZE_PLOT
•  PRO_PDFOPT_VIEW_TO_EXPORT—Enables you to specify the view or views to be exported to the PDF file. The values are:
  PRO_PDF_VIEW_SELECT_CURRENT—Exports the current graphical area to a one-page PDF file.
  PRO_PDF_VIEW_SELECT_BY_NAME—Exports the selected view to a one-page PDF file with the view name printed at the bottom center of the view port. If this value is assigned, then the value of the string property PRO_PDFOPT_SELECTED_VIEW must also be included.
  PRO_PDF_VIEW_SELECT_ALL—Exports all the views to a multi-page PDF file. Each page contains one view with the view name displayed at the bottom center of the view port.
•  PRO_PDFOPT_INCL_ANNOT—Enables you to specify if annotations must be included when Creo Parametric models are exported as U3D graphics in a PDF file. The values are:
  PRO_PDF_INCLUDE_ANNOTATION—Includes annotations when models are exported.
  PRO_PDF_EXCLUDE_ANNOTATION—Excludes annotations when models are exported. This is the default value.
The function ProPDFoptionsBoolpropertySet() sets the value for a boolean property of the PDF options structure. The types of export options are as follows:
•  PRO_PDFOPT_SEARCHABLE_TEXT—If true, stroked text is searchable. The default value is true.
•  PRO_PDFOPT_LAUNCH_VIEWER—If true, launches the Adobe Acrobat Reader. The default value is true.
•  PRO_PDFOPT_HYPERLINKS—Sets Web hyperlinks to be exported as label text only or sets the underlying hyperlink URLs as active. The default value is true, specifying that the hyperlinks are active.
•  PRO_PDFOPT_BOOKMARK_ZONES—If true, adds bookmarks to the PDF showing zoomed in regions or zones in the drawing sheet. The zone on an A4-size drawing sheet is ignored.
•  PRO_PDFOPT_BOOKMARK_VIEWS—If true, adds bookmarks to the PDF document showing zoomed in views on the drawing.
•  PRO_PDFOPT_BOOKMARK_SHEETS—If true, adds bookmarks to the PDF document showing each of the drawing sheets.
•  PRO_PDFOPT_BOOKMARK_FLAG_NOTES—If true, adds bookmarks to the PDF document showing the text of the flag note.
•  PRO_PDFOPT_RESTRICT_OPERATIONS—If true, allows you to restrict or limit operations on the PDF document using the ProPDFRestrictOperationsMode modification flags. The default is false.
•  PRO_PDFOPT_ALLOW_PRINTING—If true, allows you to print the PDF document. The default value is true.
•  PRO_PDFOPT_ALLOW_COPYING—If true, allows you to copy content from the PDF document. The default value is true.
•  PRO_PDFOPT_ALLOW_ACCESSIBILITY—If true, enables visually-impaired screen reader devices to extract data independent of the value of the enum ProPDFRestrictOperationsMode. The default value is true.
•  PRO_PDFOPT_PENTABLE—If true, uses the standard Creo Parametric pentable to control the line weight, line style, and line color of the exported geometry. The default value is false.
•  PRO_PDFOPT_PENTAB_FOR_TEXT—If true, the standard Creo Parametric pentable is used to control the thickness of the stroked text of the exported geometry. If false, the stroked text will be exported with their original thickness and the thickness value defined by the pentable will be ignored. The default value is true.
•  PRO_PDFOPT_ADD_VIEWS—If true, allows you to add view definitions to the U3D model from a file. The default value is true.
The function ProPDFoptionsStringpropertySet() sets the value for a string property of the PDF options structure. The types of export options are as follows:
•  PRO_PDFOPT_TITLE—Specifies a title for the PDF document.
•  PRO_PDFOPT_AUTHOR—Specifies the name of the person generating the PDF document.
•  PRO_PDFOPT_SUBJECT—Specifies the subject of the PDF document.
•  PRO_PDFOPT_KEYWORDS—Specifies relevant keywords in the PDF document.
•  PRO_PDFOPT_PASSWORD_TO_OPEN—Sets a password to open the PDF document. If the value is not set or NULL, anyone can open the PDF document without a password.
•  PRO_PDFOPT_MASTER_PASSWORD—Sets a password to restrict or limit the viewer operations that you can perform on the opened PDF document. If the value is set to NULL, you can make any changes to the PDF document regardless of the settings of the PRO_PDFOPT_ALLOW_* modification flags.
•  PRO_PDFOPT_SHEET_RANGE—Specifies the range of sheets in a Creo Parametric drawing that are to be exported to a PDF file. If this property is assigned, then the integer property PRO_PDFOPT_SHEETS is set to the value PRINT_SELECTED_SHEETS.
•  PRO_PDFOPT_SELECTED_VIEW—Sets the option PRO_PDFOPT_VIEW_TO_EXPORT to the value PRO_PDF_VIEW_SELECT_BY_NAME, if the corresponding view is successfully found.
The function ProPDFoptionsDoublepropertySet()sets the value for a double property of the PDF options structure. The types of export options are as follows:
•  PRO_PDFOPT_HEIGHT—Enables you to set the height for a user-defined page size of the exported PDF file. The default value is 0.0. This option is available only if the enum PRO_PDFOPT_SIZE is set to VARIABLE_SIZE_IN_MM_PLOT or VARIABLE_SIZE_PLOT.
•  PRO_PDFOPT_WIDTH—Enables you to set the width for a user-defined page size of the exported PDF file. The default value is 0.0. This option is available only if the enum PRO_PDFOPT_SIZE is set to VARIABLE_SIZE_IN_MM_PLOT or VARIABLE_SIZE_PLOT.
•  PRO_PDFOPT_TOP_MARGIN—Enables you to specify the top margin of the view port. The default value is 0.0.
•  PRO_PDFOPT_LEFT_MARGIN—Enables you to specify the left margin of the view port. The default value is 0.0.
•  PRO_PDFOPT_BACKGROUND_COLOR_RED—Enables you to specify the default red background color that appears behind the U3D model. You can set any value within the range of 0.0 through 255.0. The default value is 255.0.
•  PRO_PDFOPT_BACKGROUND_COLOR_GREEN—Enables you to specify the default green background color that appears behind the U3D model. You can set any value within the range of 0.0 through 255.0. The default value is 255.0.
•  PRO_PDFOPT_BACKGROUND_COLOR_BLUE—Enables you to specify the default blue background color that appears behind the U3D model. You can set any value within the range of 0.0 through 255.0. The default value is 255.0.
The function ProPDFExport() exports the file to a PDF document based on the export settings defined in the PDF options structure. Specify the complete name and path, including the extension of the output file.
Use the function ProPDFWithProfileExport() to repeatedly export 2D drawings to the PDF format with the same export options. These options are stored in an XML file called a profile. You can have several such profiles. The input arguments to this function are:
•  model—A drawing model to export. This drawing model must be open and the drawing window must be active.
•  output_file—The complete path to the output file with extension.
•  profile—The path to the profile to be used.
Use the function ProPDFoptionsFree() to free the memory contained in the PDF options structure.
Importing Parameter Files
Functions Introduced:
The function ProInputFileRead() imports files of several types to create data in Creo Parametric. The file types are declared in ProUtil.h. The import formats and their type constants are as listed in the following table:
Import Format
Creo TOOLKIT Functions
Type Constant
Relations file
ProInputFileRead()
PRO_RELATION_FILE
Program file
PRO_PROGRAM_FILE
Configuration options file
PRO_CONFIG_FILE
Setup file
PRO_DWG_SETUP_FILE
Spool file
PRO_SPOOL_FILE
Cable Parameters file
PRO_CABLE_PARAMS_FILE
Connector Parameters file
PRO_CONNECTOR_PARAMS_FILE
Model Tree Configuration file
PRO_ASSEM_TREE_CFG_FILE
Wirelist file
PRO_WIRELIST_FILE
SLD Variant file
SLD_VARIANT_FILE
The option PRO_RELATION_FILE reads a text file that contains a list of all the model relations and parameters relations in exactly the same format as the Creo Parametric user enters them.
Use the function ProInputFileRead() with the argument PRO_CONNECTOR_PARAMS to identify the connectors. To access parameters on connectors and their entry ports use the following arguments:
•  arg1—Represents the integer pointer to ProIdTable. ProIdTable is an integer array of component identifiers.
•  arg2—Represents the integer pointer to the number of component identifiers.
Use the function ProInputFileRead() with the argument PRO_CABLE_PARAMS_FILE to read cable parameters. You need to set the following arguments:
•  arg1—Represents a ProSolid (part pointer).
•  arg2—Represents the cable name.
Use the function ProInputFileRead() with the argument PRO_WIRELIST_FILE to read files in Mentor Graphics LCABLE format. This function does not create wires, but provides parameters from a wire list for use when creating in a harness assembly a wire with the same name as that in the LCABLE file.
Use the function ProInputFileRead() with the argument PRO_RELATION_FILE to get the individual feature relations. To access feature relations use the following arguments:
•  arg2—Represents the individual feature relations. It is an integer pointer to the feature identifier that gets the relations contained in a feature. If this is NULL you get the relations contained in the model.
•  arg3—It is an integer pointer. If it points to 1, then the relations in the file must be added to the current relations, otherwise the relations in the file must replace the current relations.
Use function ProInputFileRead() with argument PRO_SPOOL_FILE to create new spools or update existing ones.
The function ProInputFileReadWithFlags() imports files of several types to create data in Creo Parametric. The input arguments are:
•  model—A valid object in memory.
•  filename—Input file name with the file extension.
•  file_type—File type to be read or imported. This argument is specified using the enumerated data type ProImportExportFile. The valid values are:
  PRO_RELATION_FILE
  PRO_IGES_SECTION
  PRO_PROGRAM_FILE
  PRO_CONFIG_FILE
  PRO_DWG_SETUP_FILE
  PRO_SPOOL_FILE
  PRO_CABLE_PARAMS_FILE
  PRO_CONNECTOR_PARAMS_FILE
  PRO_ASSEM_TREE_CFG_FILE
  PRO_WIRELIST_FILE
  SLD_VARIANT_FILE
Note
If the input argument file_type has the valid value
then
PRO_CONFIG_FILE
The input argument model is ignored.
PRO_RELATION_FILE
The function ProInputFileReadWithFlags) does not regenerate after reading the file, it checks for the syntax errors. To regenerate the object, use the function ProSolidRegenerate().
PRO_DWG_SETUP_FILE
The function ProInputFileReadWithFlags) does not repaint the screen. If the input argument model is NULL, the function ProInputFileReadWithFlags) uses the current drawing.
PRO_CABLE_PARAMS_FILE, PRO_CONNECTOR_PARAMS_FILE, PRO_DWG_SETUP_FILE or PRO_SPOOL_FILE
The input argument filenameshould be a file name and extension, not a full path.
PRO_IGES_SECTION
This operates only on the active section of the model. You have to place the imported section geometry in the active section with a mouse click.
PRO_CONNECTOR_PARAMS_FILE
The input argument arg1 is the int pointing to ProIdTable. ProIdTable is an integer array of component identifiers.
The input argument arg2 is the integer pointer int pointing to the number which is equal to the number of component identifiers
PRO_CABLE_PARAMS_FILE
The input argument arg1 is the ProSolid part pointer.
The input argument arg2 is the wchar_t* to the cable name.
PRO_RELATION_FILE
The input argument arg2 is the integer pointerint pointing to feature ID. Pass it as NULL to get relations of the model.
The input argument arg3 is the integer pointer int. If it points to 1 then relations in the file are added to the current relations. Otherwise, the relations in the file replace the current relations.
•  flags—Bitwise flags or PRO_IMPORT_EXPORT_NO_FLAGS. This flag enables the interactive user interface in Creo Parametric. For example, if an error occurs while reading or executing an imported PRO_PROGRAM_FILE file, an interactive dialog box opens in Creo Parametric asking you if you want to continue with the operation.
•  agr1, arg2, and arg3—The application data.
•  arg4—unused
Importing 2D Models
Import Format
Creo TOOLKIT Functions
Type Constant
STEP file
Pro2dImportMdlnameCreate(),
Pro2dImportAppend()
PRO_STEP_FILE
IGES (2D) file
PRO_IGES_FILE
DXF file
PRO_DXF_FILE
DWG file
PRO_DWG_FILE
CGM file
PRO_CGM_FILE
MEDUSA file
PRO_MEDUSA_FILE
Creo Elements/Direct drafting files (.mi, .bi, and .bdl)
PRO_CCD_DRAWING_FILE
IGES (2D) file
ProInputFileRead()
PRO_IGES_SECTION
Functions Introduced:
The function Pro2dImportMdlnameCreate() imports interface files and creates a new two-dimensional model with the specified name. The created models can be drawings, layouts, diagrams, drawing formats. Use the argument to control whether or not to import two-dimensional views.
If you want to import all the drawing sheets for formats that support multiple drawing sheets, use the function Pro2dImportAllSheets(). The function imports interface files with all the drawing sheets, and creates a new two-dimensional model. For the model type PRO_MDL_DWGFORM, only the first two drawing sheets are imported.
The function Pro2dImportAppend() appends a two-dimensional model to the specified model.
You can import and append the Creo Elements/Direct drafting files using the functions Pro2dImportMdlnameCreate() and Pro2dImportAppend().
Use the function Pro2dImportMdlnameCreate() to import the Creo Elements/Direct drafting file to a Creo Parametric drawing file. The following data is imported from the .mi, .bi, and .bdl format files:
•  Basic entities such as point, line, arc, fillet, circle, polygon, text, spline, b-spline, center line, symmetry line, reference text line, and projected reference points
•  2D construction geometry such as lines, arcs, circles, splines, and so on
•  Linear, angular, radial, diameter, ordinate, and leader dimensions
•  Tolerance values in dimensions
•  Leader and non-leader notes
•  Annotation views
•  Drawing sheets, symbol, views, and layers
•  The attributes of color, layers, line types, and text fonts
•  All types of hatch including user-defined hatches
You can set the mapping options in the mapping file mi_import.pro. The entity attributes such as color, line type, text fonts, leader arrow styles and so on are imported from Creo Elements/Direct drafting files to Creo Parametric drawing files depending on the settings in the mapping file.
Refer to the Creo Parametric Data Exchange Help for more information on importing Creo/Elements Direct drafting files in Creo Parametric drawing file.
Use the function ProInputFileRead() with the argument PRO_IGES_SECTION to import a 2D IGES section into a sketch.
Importing 3D Models
The functions described in this section are used to import files of different format types into Creo Parametric.
Functions Introduced:
Import Format
Creo TOOLKIT Functions
Type Constant
ACIS file
ProIntfimportModelWithOptionsMdlnameCreate()
PRO_INTF_IMPORT_ACIS
CADDS file
PRO_INTF_IMPORT_CADDS
CATIA (.model) file
PRO_INTF_IMPORT_CATIA_MODEL
CATIA (.session) file
PRO_INTF_IMPORT_CATIA_SESSION
DXF file
PRO_INTF_IMPORT_DXF
ICEM file
PRO_INTF_IMPORT_ICEM
IGES file
PRO_INTF_IMPORT_IGES
Neutral file
PRO_INTF_IMPORT_NEUTRAL
Parasolid-based CADDS system file
PRO_INTF_IMPORT_PARASOLID
POLTXT file
PRO_INTF_IMPORT_POLTXT
STEP file
PRO_INTF_IMPORT_STEP
VDA file
PRO_INTF_IMPORT_VDA
CATIA (.CATpart) file
PRO_INTF_IMPORT_CATIA_PART
UG file
PRO_INTF_IMPORT_UG
Creo View (.ol and .ed) files
PRO_INTF_IMPORT_PRODUCTVIEW
JT Open format
PRO_INTF_IMPORT_JT
CATIA Graphical Representation (CGR) format
PRO_INTF_IMPORT_CATIA_CGR
SolidWorks Part (.sldprt) file
PRO_INTF_IMPORT_SW_PART
SolidWorks Asembly (.sldasm) file
PRO_INTF_IMPORT_SW_ASSEM
Inventor Part (.ipt) file
PRO_INTF_IMPORT_INVENTOR_PART
Inventor Assembly (.iam) file
PRO_INTF_IMPORT_INVENTOR_ASSEM
STL file
PRO_INTF_IMPORT_STL
VRML file
PRO_INTF_IMPORT_VRML
CATIA (.product) file
PRO_INTF_IMPORT_CATIA_PRODUCT
Creo Elements/Direct file (Assemblies and parts)
•  bundle—.bdl
•  modeling —soliddesigner .sda, .sdp,.sdac, and .sdpc
•  package—.pkg
PRO_INTF_IMPORT_CC
Solid Edge Part (.par) file
PRO_INTF_IMPORT_SEDGE_PART
Solid Edge Assembly (.asm) file
PRO_INTF_IMPORT_SEDGE_ASSEMBLY
Solid Edge Sheet metal (.psm) file
PRO_INTF_IMPORT_SEDGE_SHEETMETAL_PART
3D Manufacturing Format (3MF)
PRO_INTF_IMPORT_3MF
The following data is included during the import of models from other formats to Creo Parametric:
•  3D Manufacturing Format (3MF)—From Creo Parametric 5.0.1.0 onward, you can import 3MF files containing part and assembly models to Creo Parametric. You can import part-level colors, top-assembly parameters, and facet geometry from 3MF models to Creo Parametric.
•  Autodesk Inventor—You can import Autodesk Inventor models to Creo Parametric. The import includes basic geometry such as solids, quilts, and surfaces from Autodesk Inventor models to Creo Parametric. You can also import datum features, colors, attributes, and wire body datum curves from Inventor part and assembly models.
Note
Depending on the Autodesk Inventor model, Creo Parametric imports the model as a part or an assembly. To let Creo Parametric decide if the Autodesk Inventor model must be imported as a part or assembly, in the function ProIntfimportModelWithOptionsMdlnameCreate(), you must specify the input argument ProMdlType as PRO_MDL_UNUSED.
•  JT—JT models are imported to Creo Parametric with their color overrides. Components with color overrides at any level in an assembly structure are supported.
From Creo Parametric 3.0 onward, the Product Manufacturing Information (PMI) of the annotations is imported as semantic representation from JT models to Creo Parametric models. The semantic import is supported only for 3D notes and basic dimensions. All the other types of annotations are imported as graphical entities. You can import the planar and zonal cross-sections of part and assembly models from JT files to Creo Parametric.
Note
From Creo Parametric M200 2.0 onward, the license INTF_for_JT is required to import a JT file to Creo Parametric. If the license is not available the functions return the error PRO_TK_NO_LICENSE.
•  Creo Elements/Direct—From Creo Parametric 3.0 onward, the Product Manufacturing Information (PMI) of the annotations is imported as semantic representation fromCreo Elements/Direct models to Creo Parametric models. The semantic import is supported only for 3D notes and basic dimensions. All the other types of annotations are imported as graphical entities. You can also import the clipping features owned by the Creo Elements/Direct part and assembly models as cross-sections in Creo Parametric.
•  Creo View—You can import colors assigned to the components of assemblies and their sub-assembly models, including the colors of the sub-level entities such as parts, quilts, and faces from Creo View to Creo Parametric. Creo View models are imported to Creo Parametric with their color overrides. Components with color overrides at any level in an assembly structure are supported. Along with components, color overrides are also supported for component model items, such as, face and quilts.
•  SolidWorks—You can import basic geometry such as solids, quilts, and surfaces from SolidWorks models to Creo Parametric. The import includes datum features, colors, attributes, and layers.
Note
Depending on the SolidWorks model, Creo Parametric imports the model as a part or an assembly. To let Creo Parametric decide if the SolidWorks model must be imported as a part or assembly, in the function ProIntfimportModelWithOptionsMdlnameCreate(), you must specify the input argument ProMdlType as PRO_MDL_UNUSED.
•  Solid Edge—From Creo Parametric 3.0 M010 onward, you can import Solid Edge part and assembly models to Creo Parametric. The import includes boundary representation geometry, datum features, colors, and attributes.
From Creo Parametric 3.0 M030 onward, Solid Edge models are imported to Creo Parametric with their color overrides. Components with color overrides at any level in an assembly structure are supported.
From Creo Parametric 3.0 M020 onward, you can also import a Solid Edge sheet metal part to Creo Parametric.
Note
Depending on the Solid Edge model, Creo Parametric imports the model as a part or an assembly. To let Creo Parametric decide if the Solid Edge model must be imported as a part or assembly, in the function ProIntfimportModelWithOptionsMdlnameCreate(), you must specify the input argument ProMdlType as PRO_MDL_UNUSED.
•  Unigraphics—You can import basic geometry such as solids, quilts, and surfaces from Unigraphics models to Creo Parametric. The import includes datum features, colors, attributes, and layers.
Note
Depending on the Unigraphics model, Creo Parametric imports the model as a part or an assembly. To let Creo Parametric decide if the Unigraphics model must be imported as a part or assembly, in the function ProIntfimportModelWithOptionsMdlnameCreate(), you must specify the input argument ProMdlType as PRO_MDL_UNUSED.
Note
Refer to the Creo Parametric Data Exchange Help for more information on importing geometry to Creo Parametric. Refer to the compatibility matrix on PTC.com for the supported software versions.
The function ProIntfimportSourceTypeGet() is a utility that returns the type of model that can be created from the geometry file. This function is not applicable for all formats. If this function is not valid for a geometric file, you will need to know the type of model you want to create (part, assembly, or drawing).
The function ProIntfimportWithProfileSourceTypeGet() determines the type of model expected to be created by the import operation based on the profile settings. The input arguments follow:
•  import_file—Full path to the import file.
•  profile_file—Full path to the profile file. If the value of this argument is passed as NULL, the default profile is used.
•  type—The type of file to be imported.
The output argument of the function mdl_type is the type of model that can be created from the specified import file and profile settings.
The function ProIntfimportModelWithOptionsMdlnameCreate() imports objects of other formats using a profile and creates a new model or set of models with the specified name and representation. Once the profile is set, it remains valid for the entire session unless it is reset with another profile. The input arguments of this function are:
•  import_file—Full path to file to be imported.
•  profile—The import profile path. An import profile is an XML file with the extension .dip. It contains the options that control an import operation. It also contains all the options for the supported 3D import formats. Refer to the Creo Parametric Online Help for more information on creation and modification of import profiles.
Note
The input argument profile allows you to include the import of Creo Elements/Direct containers, face parts, wire parts, and empty parts.
•  type—The type of file to be imported.
The following formats are supported for importing structure and graphics level of details:
  Creo View (i.e. Product View, .ol, .ed, .edz, .pvs, .pvz) files (PRO_INTF_IMPORT_PRODUCTVIEW)
  CATIA V5 (CATPart (PRO_INTF_IMPORT_CATIA_PART, CATProduct (PRO_INTF_IMPORT_CATIA_PRODUCT), CGR (PRO_INTF_IMPORT_CATIA_CGR)) files
  SolidWorks (.sldprt (PRO_INTF_IMPORT_SW_PART), .sldasm(PRO_INTF_IMPORT_SW_ASSEM)) files
  Unigraphics NX (PRO_INTF_IMPORT_UG) files
•  create_type—The type of model to create. This could be part, assembly, or drawing (for STEP associative drawings).
•  rep type—The representation type to be used for importing. The enumerated type ProImportRepType defines the representation type and has the following values:
  PRO_IMPORTREP_MASTER—This is the default import type. It imports the geometric and the nongeometric data (annotations, datums, coordinate systems, creation of features and so on) of the assembly and displays the full representation of the assembly.
  PRO_IMPORTREP_STRUCTURE—Imports the product structure or the meta data of the assemblies.
  PRO_IMPORTREP_GRAPHICS—Imports the display data of the assemblies.
Note
The import representation types PRO_IMPORTREP_STRUCTURE and PRO_IMPORTREP_GRAPHICS do not create model geometry in Creo Parametric, although they allow the import of the fully-functional assemblies.
•  new_model_name— The name of the new top level import model.
•  filter_func—Callback to the function ProIntfimportLayerFilter() that determines how to display and map layers from the imported model. If this is NULL, the default layer handling will take place.
•  application_data—The application data to be passed to the filter function. Can be NULL.
•  created_model—The handle to the created model (in case of an assembly – the handle to the top assembly). Even if this is NULL, the model is created.
Note
•  When importing an assembly using the function ProIntfimportModelWithOptionsMdlnameCreate() if any component of the assembly is missing, then during import an empty placeholder with the missing component name is created in the model tree. For example, during import if the missing component is a part, an empty part is created. Similarly, if the missing component is a subassembly, then an empty subassembly is created. Placeholders for missing components are created only for the following formats:
  CATIA V5
  CATIA V4
  Unigraphics
  CADDS 5
  SolidWorks
  Creo View (.ol and .ed) files
  JT Open format
•  Use the function ProIntfimportModelWithOptionsMdlnameCreate() with profile as NULL and rep type (representation type) as PRO_IMPORTREP_MASTER.
  From Creo Parametric 3.0 M080 onward, the function ProIntfimportModelWithOptionsMdlnameCreate() imports a JT file to Creo Parametric only if the license INTF_for_JT is available. If the license is not available the functions return the error PRO_TK_NO_LICENSE.
  From Creo Parametric 2.0 M200 onward, the function ProIntfimportModelWithProfileCreate() imports a JT file to Creo Parametric only if the license INTF_for_JT is available. If the license is not available the functions return the error PRO_TK_NO_LICENSE.
The function ProIntfimportModelWithProfileCreate() imports objects of other formats using a profile and creates a new model or set of models with the specified name.
The function ProIntfimportModelWithProfileCreate() has been deprecated. Use the function ProIntfimportModelWithOptionsMdlnameCreate() instead with PRO_IMPORTREP_MASTER as the representation type.
The function ProIntfimportLayerFilter() is a callback function that allows your application to determine the status of each of the imported layers. You can modify the layer information using the functions described in the next section.
Modifying the Imported Layers
Layers help you organize model items so that you can perform operations on those items collectively. These operations primarily include ways of showing the items in the model, such as displaying or blanking, selecting, and suppressing. The methods described in this section modify the attributes of the imported layers.
Functions Introduced:
Imported layers are identified by their names. The function ProLayerfilterdataNameGet() returns the name of the layer while the function ProLayerfilterdataNameSet() can be used to set the name of the layer.
The function ProLayerfilterdataCountsGet() specifies the following:
•  Number of curves on the specified layer
•  Number of surfaces on the specified layer
•  Number of trimmed surfaces on the specified layer
The function ProLayerfilterdataActionSet() sets the display status of the imported layers. You can set the display status of the layers to one of the following:
•  Show—Display the specified layer.
•  Blank—Make the specified layer blanked.
•  Hidden—(Assembly mode only) Make the specified layer hidden.
•  Skip—Do not import the entities on this layer.
•  Ignore—Import only entities on this layer but not the layer
Example 5: Importing a 3D Model With Layer Filter Options
The sample code in UgInterfaceImport.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_interface shows how to import from an IGES file while filtering out a certain layer to be renamed and blanked, using the filter function UserLayerFilter(). It also demonstrates how to use the function ProIntfimportSourceTypeGet() to determine the type of the model.
Validation Score for Imports
Functions Introduced:
You can import CATIA V5, NX, SolidWorks, SolidEdge, Autodesk Inventor, and Creo View files with various properties such as surface area, volume, and the coordinates for the center of gravity (COG) into Creo Parametric. After import, Creo Parametric has to calculate the value of these properties and report if there are any differences in the values. Also general failures during import, such as, failure to import an assembly component or failure to solidify a part must be reported.
To report the value differences and failures, the validation score for a model is created. The validation score is created for imported, regenerated, or updated models. The properties such as, surface area, volume, and the coordinates for the center of gravity (COG) are converted in to geometrical validation properties. Assembly models include the validation property that is related to the product structure. Creo Parametric compares the validation properties of the imported models with the mass properties of the source models and computes a score of the data conversion. The validation score of a model PTC_VAL_IMP_SCORE is a model parameter. The score is created for the parent assembly and its individual components and has the following values:
•  PASS
•  PASS_WITH_WARNINGS
•  FAIL
Use the function ProIntfimportValidationscoreCalculate() to calculate the validation score for the specified model. The function ProIntfimportValidationscoreGet() retrieves the validation score for the specified model, where the score is already calculated using the function ProIntfimportValidationscoreCalculate().
The validation score depends on the data conversion from source files to Creo Parametric. If you want certain parameters to be ignored and passed, you can set these preferences for validation data in the config.val file. Use the function ProIntfimportValidationpreferencesLoad() to specify the config.val file that must be used to load the preferences for data validation while calculating validation score.
Refer to the Creo Parametric Data Exchange online help, for more information.