User's Guide > Interface: Data Exchange > Exporting 3D Models
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)
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
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
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)
ProProductviewFormattedExport()
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
N/A
Shrinkwrap
ProSolidShrinkwrapCreate()
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.
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.
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. The inputs arguments are as follows:
model—Specify the pointer to the model to be exported and is specified using the object ProMdl.
output_file_name—Specify the output file name.
file_type—Specify the file type to be exported and is defined using the enumerated data type ProImportExportFile.
parameters—Specify 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—Specify 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.
transf —Specify the transformation matrix. This is the transformation from the result in the Assembly (top model) coordinates to the desired result (at selected coordinate system, if any). If the value is set to NULL, no matrix is applied.
comp_path—Specify the component path, in the case of an assembly component. This is used to compute selected model's transformation in current assembly. If the model is a part, set this to NULL.
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.
這是否有幫助?