Exporter

Detailed Description

class Exporter

The Exporter class converts a CAD file and exports it to a variety of output formats

Public Functions

Exporter()
~Exporter()
bool Init(Importer *importer)

Initializes the importer with an importer object

bool WriteMeasurement(char const *utf8_json_filename, SC_Export_Options export_options)
bool WriteSC(char const *utf8_model_path, char const *utf8_scs_filename, SC_Export_Options export_options)

Exports a SC Instance.

Parameters
  • utf8_model_path – Full path of the output SC model directory

  • utf8_scs_filename – Full path of the output .scs or nullptr or empty string if none is desired

  • export_options – Object defining the export settings for writing out the stream cache instance

Returns

True if file export completed successfully.

bool WriteHTML(const char *utf8_html_path, const char *utf8_html_template_path, SC_Export_Options export_options)

Exports a self contained HTML file

Parameters
  • utf8_html_path – Full path of the output html file

  • utf8_html_template_path – Full path of the html template file

  • export_options – Object defining the export settings for writing out the stream cache instance

Returns

True if file export completed successfully.

bool WriteXML(const char *out_filename, SC_Export_Options export_options)

Exports a XML File

Parameters
  • out_filename – Name of the XML file

  • export_options – Object defining the export settings

Returns

True if file export completed successfully.

bool WritePNG(char const *outFilename, int xres, int yres, Color backgroundColor, Camera *cameraOverride = nullptr, ViewOrientation viewOrientation = ViewOrientation::Unspecified, bool fitWorldExact = false, bool enableHiddenLine = false, bool enableTransparentBackground = false, bool exportPmi = true, RenderingMode renderingMode = RenderingMode::ShadedWithLines, LightingMode lightingMode = LightingMode::Lighting2016)

Exports a png file with the specified resolution.

Parameters
  • outFilename – Name of the PNG file.

  • xres – Horizontal resolution of the PNG image.

  • yres – Vertical resolution of the PNG image.

  • backgroundColor – Image background color.

  • cameraOverride – If non-null, PNG export uses this camera. Otherwise the default camera is used.

  • standardView – If specified, the camera used for export has its orientation changed to that of the supplied standard view.

  • fitWorldExact – If true, the camera used for export is fitted around the entire scene.

  • enableHiddenLine – If true, hidden line rendering is enabled for the exported PNG image.

  • enableTransparentBackground – If true, the image background will be transparent.

  • exportPmi – If true, PMI will be shown.

  • renderingMode – Specifies the rendering mode for the exported PNG image. If enableHiddenLine is true, the rendering mode will be hidden line.

  • lightingMode – Specifies the lighting mode for the exported PNG image. 0 = HC 2015 lighting, 1 = HC 2016 and newer.

Returns

True if file export completed successfully.

bool WriteHSF(char const *out_filename)

Exports a HSF file.

Parameters

out_filename – Name of the HSF file

Returns

True if file export completed successfully.

bool WritePDF(char const *out_filename, const char *template_filename, const char *modify_list, Color background_color, SC_Export_Options export_options)

Exports a 3D PDF File (currently not supported on Linux)

Parameters
  • out_filename – Name of the PDF file

  • template_filename – Name of the template file used for the PDF generation (required)

  • modify_list – List of field modifications that will be applied to the specified template. Example: “Filename$$Part.CatPart$$FileType$$CatiaModel”

  • background_color – PDF background color

Returns

True if file export completed successfully.

bool WritePRC(const char *out_filename, SC_Export_Options export_options)

Exports a PRC file.

Parameters

out_filename – Name of the PRC file

Returns

True if file export completed successfully.

bool WriteSTEP(const char *out_filename, SC_Export_Options export_options)

Exports a STEP file.

Parameters
  • out_filename – Name of the STEP file

  • export_options – Object defining the export settings for writing out the STEP File

Returns

True if file export completed successfully.

bool WriteSTL(const char *out_filename, SC_Export_Options export_options)

Exports a STL file.

Parameters
  • out_filename – Name of the STL file

  • export_options – Object defining the export settings for writing out the STL File

Returns

True if file export completed successfully.

bool WriteXT(const char *out_filename)

Exports a XT file.

Parameters

out_filename – Name of the XT file

Returns

True if file export completed successfully.

bool Write3MF(const char *out_filename, SC_Export_Options export_options = SC_Export_Options())

Exports a 3MF file.

Parameters
  • out_filename – Name of the 3MF file

  • export_options – Optional object defining the export settings for writing out the 3MF File

Returns

True if file export completed successfully.

bool WriteJT(const char *out_filename, SC_Export_Options export_options = SC_Export_Options())

Exports a JT file.

Parameters
  • out_filename – Name of the JT file

  • export_options – Optional object defining the export settings for writing out the JT File

Returns

True if file export completed successfully.

bool WriteDependencies(const char *out_filename, SC::Store::MemoryDevice *memory_device = nullptr)

Exports a text file containing all dependencies.

Parameters
  • out_filename – Name of the dependencies file

  • memory_device – An optional MemoryDevice used to sandbox IO.

Returns

True if file export completed successfully.

bool WriteXMLBOM(const char *out_filename, SC::Store::MemoryDevice *memory_device = nullptr)

Exports a XML file containing BOM.

Parameters
  • out_filename – Name of the XML BOM file

  • memory_device – An optional MemoryDevice used to sandbox IO.

Returns

True if file export completed successfully.

bool WriteConfigFile(const char *out_filename, SC::Store::MemoryDevice *memory_device = nullptr)

Exports a text file containing configuration list.

Parameters
  • out_filename – Name of the text file

  • memory_device – An optional MemoryDevice used to sandbox IO.

Returns

True if file export completed successfully.

bool WriteSCMaster(const char *xmlFile, const char *modelsPath, const char *outputFile, SC_Export_Options export_options)

Given an XML file, will build a master model file, corresponding to the XML file content and referencing all the external model files

Parameters
  • input – XML file

  • modelsPath – Directory of the shattered model parts

  • outputFile – Name of the output stream cache directory

  • export_options – Object defining the export settings for writing out the stream cache instance

Returns

True if file export completed successfully.

bool WriteSCShattered(SC_Export_Options export_options)

Will export a separate SC model for each part of the assembly and/or exports an XML representing the assembly structure and referencing those SC models

Parameters

export_options

  • If export_options.prepare_shattered_parts is defined, it will export a SC model for each part.

  • If export_options.prepare_shattered_scs_parts is defined, it will export a SCS file for each part.

  • If export_options.prepare_shattered_xml is defined, it will export an XML representing the assembly structure and referencing those SC models

Returns

True if file export completed successfully.