Export to StreamCache
The following example exports an imported CAD file to the StreamCache format for viewing in HOOPS Web Viewer:
To generate a single, self-contained SCS file, change the second argument to the filepath for the location of your SCS file:
Export to PNG with Custom Camera
The following example uses a Communicator::Camera "custom camera" to write a PNG image:
Export to PNG with Pre-Defined View
The following example uses predefined views to write a PNG image. These views are defined in the Communicator::ViewOrientation enum.
Export to Shattered Parts
The following example exports a model to shattered parts:
When Communicator::SC_Export_Options::prepare_shattered_xml is set to true in the export options, calling Communicator::Exporter::WriteSCShattered() will write an XML file containing the full assembly structure referencing the external models. Each of these parts will be exported to its own distinct StreamCache model directory.
After the shattered parts are exported, calling Communicator::Exporter::WriteSCMaster() will generate a master StreamCache directory (or SCS file) that references the parts directory created earlier by Communicator::Exporter::WriteSCShattered(). When the master StreamCache instance is loaded in the WebViewer, the individual parts will be available in the model tree.
Export to HTML with a Template
The following example exports a file to HTML, using the customizable Communicator HTML template that includes basic UI features:
These templates are both located in the following location:
More information about HTML export can be found in the Monolithic HTML Export Programming Guide.
Export to PDF with a Template
Note: PDF export requires a HOOPS Publish license.
The following example exports a model to a PDF file with a black background using a PDF template:
A PDF template is available in the Communicator package, located in one of the following locations: