Using scripts for batch operations
Hull Clone is a command line utility that allows standalone batch processing in a CADMATIC Hull project. The Hull Clone feature provides you with the possibility to use scripts (JavaScript) to execute heavy operations such as updating, recalculating or exporting all blocks. The hullclone.exe utility comes with the CADMATIC Hull installation, and it is run from the Windows Command Prompt window.
Hull Clone uses the MuJS JavaScript interpreter to parse the JavaScript code. MuJS implements ECMAScript specification ECMA-262. Any JavaScript code supported by ECMA-262 can be used in the Hull Clone scripts. For information about the MuJS JavaScript interpreter, visit https://mujs.com.
Important: The Hull Clone feature requires a Hull Structure license to be present, but the license will not be used. Also the license server name must be defined. Hull Clone reads the license server host name from the %DM_NLC_HOST% environment variable. If this value is not available, Hull Clone will not run. The license server host name can be defined when installing CADMATIC Hull, as License Server on the License page of the Setup Wizard.
Scripts can be run on any machine that is connected to the project and has access to project data. Any adjustments done on a site with no access to project data will be lost.
Note: Hull Clone is considered a normal Hull user by the system. This means that if Hull Clone is active in a block, other users cannot execute COS operations in the same block at the same time. Similarly, if a user is active in a block, COS operations contained in a Hull Clone script cannot be executed in that block. However, getting and saving construction is possible even if multiple users are active in the block.
The Hull Clone feature helps to significantly reduce the time needed for the following operations:
- Updating blocks
- Recalculating blocks
- Exporting 3D data
- Hull shape updates
- Updates of changes in parameters or reference planes in HiLTop
- Preparing blocks for Outfitting
For detailed information on how to run scripts with the Hull Clone functionality, see Running scripts with Hull Clone.
See Recalculating all blocks for an example script.
Total weight of the ship
By using a JavaScript script you can also generate reports containing the total weight of the ship. The script calls the report generator to do the calculations. A report layout is needed to specify what is to be calculated.
For detailed information on how to determine the total weight of the ship by using a JavaScript script and the report generator, see Determining ship's total weight.