The following is a list of code samples available to HOOPS Publish developers. These samples are short applications that demonstrate a specific functional topic. The source code for each sample is distributed as part of the HOOPS Publish package. The sample sources are located at <publish_install_dir>/samples/publish/publishsource/. Before running each sample, you must first build it. Visual Studio project files are included. Pre-generated PDF files from these sample are distributed in the package in the package at <publish_install_dir>/samples/publish/publishgallery/Coding_Samples/.
If you've licensed HOOPS Publish Standard, you should load the publishstandard.sln solution. If you've licensed HOOPS Publish Advanced, you should load publishadvanced.sln solution.
HOOPS Publish Standard Samples
Samples Available in HOOPS Publish Advanced
In addition to the examples listed below, the HOOPS Publish package includes example 3D PDF files and example PDF templates that you can use in your own application.
This sample demonstrates how to import and export a CAD file.
This sample demonstrates how to create a PRC file with the Publish API. The only input is the output file path. The program generates a PRC file containing a tessellated textured cube that is instantiated multiple times. The generated output also contains PMIs and Views, as well as links between markups, Views, and entities.
This sample creates a simple 3D PDF programmatically without using a template.
Based on a supplied PDF template, this sample shows how to activate an animation in a U3D file with a button click in a PDF form.
This sample demonstrates how to create and activate a simple view that changes camera when clicking on a button.
This sample application demonstrates how to create a document with diffrent pages inserted from different sources. It also demonstrates the creation of tables on a PDF page. Warning: this sample needs the free add-on TableToPDF to be installed.
Samples Only Available in HOOPS Publish Advanced
Shows how to create a Technical Data Package. It works with 3D annotated models and demonstrates how to insert 3D elements, how to add a view carousel that activates annotation views, and how to attach files (such as STEP files) to create a TDP.
It also demonstrates how to link 2D and 3D content and update what's displayed in some text fields when certain PMI are selected.
Demonstrates how to create a scrolling table with 3D assemblies. The scrolling table represents a Bill of Materials. When a line is selected, the 3D Part it's linked to is highlighted. Conversely when a 3D node is selected in the scene, the table line it's linked to is highlighted
This sample application demonstrates miscellaneous functionalities for HOOPS Publish Advanced.
This sample application demonstrates how to generate a PDF document with layers using HOOPS Publish.
This sample application demonstrates how to export a 3D model to HTML using HOOPS Publish. The sample shows how to generate a single monolithic HTML file and also how to generate an SCS stream cache file to be used with an HTTP server. Note that a sample HTTP server is provided to demonstrate how to implement an SCS workflow. See the section Viewing 3D in the Browser in our programming guide for more details.
This sample application demonstrates how to update a PDF file generated with Tetra 4D Enrich, using HOOPS Publish. See the section Using Tetra 4D Enrich templates in our programming guide for more details.