Frequently Asked Questions
Where can I get a new license for HOOPS Communicator?
Please review our License key page for details.
The start_server.bat/sh fails to run, and/or convert_file.bat/sh results in a “cannot open file” error.
Please ensure you run these scripts with admin privileges, and any output directories have write privileges.
Is the Stream Cache file format backward compatible?
The Stream Cache format is backward-compatible starting with HOOPS Communicator 2016 SP2.
What are the file extensions for Communicator/Stream Cache files?
There are two primary file types generated by Communicator. An .scs file is a compressed and standalone file containing all of the 3D model data. It is not streamable by the server and will be loaded by the viewer directly via an http request. An .scz file is a single file containing all model data in a streamable form. Its a single file version of a stream cache directory.
Will the node IDs always be the same between loads of the viewer?
Yes, but loading multiple models in the same scene requires accounting for a shift in node IDs. Here’s how to do this:
After you’ve loaded your first model, you’ll want to keep track of the shift before loading a new model. These two lines show how to capture the shift amount from the viewer:
const model = hwv.model; const nodeOffset = model.getLowestAvailableNodeId();
Now anywhere you need the persistent node ID you would do something like this:
const id = selection.getNodeId() - nodeOffset;
This will always allow you to get back to the persistent ID for retrieving associated application level data. For more information, see the Assembly Tree Node IDs page.
What’s the difference between a PartId and a NodeId?
In the Communicator documentation, you may notice that certain functions contain parameters with specific types - for example, the function Communicator.Model.getNodeLineColor(partId, lineIndex)
takes a Communicator.PartId as a parameter!
But for many users, Communicator is a Javascript API, so why are there types listed in the documentation? The object types found in parameters and return values in the Communicator API Reference documentation are extracted from strongly typed objects in Communicator’s TypeScript source. Communicator’s Web Viewer API is available in both TypeScript and Javascript.
In Javascript, both the Communicator.PartId and Communicator.NodeId translate to a generic Javascript number
value type (by “value type” we simply mean that variables in Javascript do not have types, but their values do).
Nevertheless, even for Javascript users it’s still helpful to know the expected type of object for each parameter, and so the documentation preserves the original TypeScript signatures to let users know the expected type of assembly tree node the function expects as a parameter.
To further clarify, let’s walk through a usage scenario. Say, for example, we’re using the SelectionManager in the Web Viewer and we select a part of the model with a mouse click.
If we then call myViewerInstance.selectionManager.getFirst().getNodeId()
, and pass the return value (a NodeId
) as the first parameter for getNodeLineColor(partId, lineIndex), would it be valid to pass a Communicator.NodeId value for the Communicator.PartId parameter?
In TypeScript, because the Communicator API defines a Communicator.PartId as a type of Communicator.NodeId, in our hypothetical call to getNodeLineColor(partId, lineIndex)
there will be no type compatibility issues with passing the value of myViewerInstance.selectionManager.getFirst().getNodeId()
for the Communicator.PartId parameter.
In terms of API behavior for both TypeScript and Javascript users, as long as the Communicator.NodeType of the Node in question is indeed a Part (and not a PMI, CADView, Sheet, or other Communicator.NodeType), then the function will behave as expected.
To query a Node in order to find out its type, call getNodeType()
.
How do I access the attributes/properties of a CAD file in HC?
First you have to make sure to add this option to the converter.exe command line:
Then, you can access the attributes via the XML file saved during conversion and/or in the web client like so:
function selectionChanged(selection: Communicator.Selection.SelectionItem) {
const model = hwv.model;
const parent = model.getNodeParent(selection.getNodeId());
model.getNodeProperties(parent).then(function (response) {
console.log(response);
});
}
You can also access the attributes as you perform the translation to Stream Cache. Use the above-mentioned flag to export the attributes, and specify --output_xml_assemblytree "file.xml"
.
You’ll then be able to parse the XML file and get the attributes and other info about the model.
If I’m using the SCS workflow/loading, do I need to run the server?
No, but you lose a lot of functionality by going with the SCS workflow, including the streaming mechanism.
How does HC handle units?
A PRC file can have multiple units for different subassemblies, which is something HC keeps track of and resolves. You can query the unit multiplier from the model object which is the same for the whole model using myModel.getUnitMultiplier();
.
For more information about units, please see the Working with Units section.
When I start my web application the default viewer just displays a spinner in the bottom left and never does anything else.
This means there was some kind of error in your JavaScript or error contacting the Service Broker that wasn’t handled. Open the debugger in your web browser and have a look at the console output. There is usually an error that will start you down the correct debugging path.
I’m seeing the error “Web page was not allowed to create a WebGL context” in the web browser debug console.
Could not create canvas: Web page was not allowed to create a WebGL context.
This usually means that the machine doesn’t have a sufficient graphics card/GPU to run 3D graphics apps in the browser. Often times we’ll see this when a user is trying to access HC from a VM or when they are accessing a machine via Microsoft Remote Desktop. RDP disables 3D acceleration (although in some cases it seems not to) so it causes issues.
A good test is to try this link and see if WebGL works: http://webglsamples.org/aquarium/aquarium.html This will help you determine if the problem is HC specific or not.
I’m seeing a “no status file” error in the web viewer when I try to load it.
This indicates there is an issue with your stream cache directory. It’s usually one of the following:
The root file in your stream cache is corrupt/damaged/not there
The stream cache directory is not accessible from your viewing instances
The stream cache directory does not exist
The stream cache directory was not specified correctly in your settings file
Is animation supported in HC?
Yes. During the 2021 release cycle, an HOOPS Web Viewer Animation API was added.
In libconverter on Linux, how do I fix the following ‘undefined reference’ error?
undefined reference to 'Communicator::Importer::Init(Communicator::Converter*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)'
As of HOOPS Communicator 2019, we use GCC 6.3.1 (specifically, the version from devtoolset-6 6.1 on CentOS 6.9) with -std=c++11. Please note that we are not using the C++11 ABI that is used by default by GCC 5 and later, so code that calls functions in libconverter (and probably any other code that interacts with that code) needs to be compiled with the -D_GLIBCXX_USE_CXX11_ABI=0
flag. Using this flag is likely the solution to the error listed above.