Creating CGF files
Introduction
In Hull COS the 3D geometry data is stored in a single .cgfx file for each logistical part and the files are stored under the cgf subfolder of each block folder. These files must be generated before saving construction data to COS. The files can be generated in two ways.
-
When the construction is saved to COS, the system automatically creates the .cgfx files if they are missing or out of date.
-
When converting from Hull HDX to Hull COS, many files need to be generated at once and two methods are available to speed up the initial generation of these files.
Two command line tools are available for generating CGF files:
-
The gdl2cgf tool(gdl2cgf.exe) generates CGF files directly from GDL files. This tool is designed to be run as a standalone command line tool.
It is recommended to use the gdl2cgf tool because it runs much faster than the gencgf tool. In tests the tool has converted up to 300.000 files in 10 minutes. For each GDL file that contains a tessellation, the tool will check if a corresponding BREP file is available, and use it if present. It is recommended to use the gencgf only as a fallback if problems arise when running gdl2cgf.
-
The gencgf tool (gencgf.exe) creates CGF files from the geometric data in the construction database.The system will do a full recalculation of each part. This tool is designed to be run from within Hull Clone.
The geometry database needs to be up to date. Partial recalculations are usually needed for this (in the example script below, the models_only mode is used for this).
Example script for using the gencfg tool
The Hull Clone script below can be used to run a CGF generation executable in each block in the project, after adding the data to the COS project, but before entering the project for the first time. The script will also take care of saving each block for the first time to COS.

print("project name: " + currentProject());
executeInHullServer("models_only on");
var i=0;
var usrIdx;
for (i = 0; i < blocks.length; ++i)
{
if (isVirtualBlock(blocks[i])) continue;
if (!is3Dblock(blocks[i])) continue;
if (!switchBlock(blocks[i])) continue;
print("############ Update G block data:"+currentBlock());
system("construct camuptodate db0g server");
waitForHullServer();
print("############ Create cgf's of block "+currentBlock());
system("gencgfs block "+currentBlock());
print("############ Blocks done:"+i);
print('##############################################################')
print("Saving construction in blocks " +currentBlock());
var saveCmd = system("hcc", "hull block save " +currentBlock());
print(saveCmd.output)
}
By default Hull executables use DDE for interprocess communication. However, this may cause problems, especially for long-running processes, like the conversion script above. Therefore, the Hull Clone utility can be started with the option /c tcp_ip
.
With this command line option all communication between the Hull Clone utility and the Hull Server, as well as between Hull executables and the Hull server, will use the stable TCP/IP protocol. The Hull Server will listen on the first available port from the range 51000-51050. When using this option, make sure the firewall settings allow this. For more information, see the Hull Clone Syntax.