![]() |
Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2023.
|
At the beginning, the script engine used to rely on Qt Script to provide a Javascript interface to communicate with the application.
Unfortunately, Qt Script isn't maintained anymore.
Starting with Cyclone 3DR 2023.0, the script engine has been ported to the V8 engine which fully replaces Qt Script.
This offers a better compliance with the Javascript standard and more flexibility to develop powerful scripts.
On the counterpart, some scripts may require edition to make them run correctly in the new engine.
The goal of this page is to help you to check most common errors that you may encounter while running existing code in the new engine.
The following changes has been made which can break your script.
This method was changed during the migration:
Those components have been removed. Use the specific enum and method of the object class instead (such as SCloud.CloudRepresentationTypeEnum and SCloud.SetCloudRepresentation).
Here is an example where changes are required:
It can be fixed like this:
Those errors are now triggered due to V8 engine being more compliant with Javascript standard.
0 can no longer be used as a valid value for javascript objects values: null must be used instead.
The method ScriptUtil.GetCameraDirection() can optionaly accept a target point as input.
Previously, the following instruction was valid:
This code now generates an error and can be fixed the following way:
Writting 0 or 1 instead of boolean values (false, true) now generates a warning.
For example, the method SPoly.PipeTubeAlongPath allow to fill the output pipe or not.
Previously, the following instruction was valid:
This code now generates a warning. The good practice is to use true or false whenever a boolean value is used:
Previously, it was possible to pass Array instead of Map. It could lead to silent conversion errors.
The method SDialog.AddLine can be configured through a configration Map object.
Have a look at the following sample:
Previously, the following instruction was not valid but didn't generate an error.
As a result, the desired alignment wasn't respected.
This code now generates an error and can be fixed the following way: