Batch Mode Translation

VCollab Suite provides a batch utility called VMoveCADBatch.exe. It is used to generate cax files without user intervention and helps CAD users in automating the cax generation process. Its usage is as follows:

VMoveCADBatch.exe [option=value] <input_cad_file/input_directory> <output_cax_file/output_directory>

<input_cad_file/input_directory> represents the input_cad_file or the input_directory

<output_cax_file/output_directory> represents the the output_cad_file or output_directory

The above two arguments are mandatory to the VMoveCADBatch.exe

File Mode

One very common usage scenario of VMoveCADBatch is to translate the given model file into a cax / cgr file. This can be achieved by providing the model file path and cax file path specifying no options. For example, the following command loads the file part2.catpart from samples folder and creates a cax file named part2.cax in samples folder.

VMoveCADBatch.exe samplespart2.catpart samplespart2.cax

Directory mode

One very common usage scenario of VMoveCADBatch is to translate all the CAD files from the input folder into CAX / CGR files in a specified output folder. This can be achieved by providing the input directory path and output directory path specifying no options. For example, the following command loads the all the CAD files from cad_files folder and creates equivalent CAX files in cax_files folder.

VMoveCADBatch.exe --dir cad_files cax_files

Several of options provided by VMoveCADBatch are mentioned below. The following options can be used in any order.

Options:

S.No.

Option

Description

1

--dir

Specifies the input mode as directory

2

--output-format

Specifies the output format. It can be CAX or CGR. By default, it is CAX. This option is generally used for directory mode

3

--tess-tolerance-mode

Selects which tessellation tolerance criteria are applied. It can be linear, angular or both. By default, it is linear. Each mode carries its own default tolerance values. See Tessellation Tolerance below.

4

--tess-tolerance

Specifies the linear (sag) tolerance for tessellation, i.e. the maximum distance allowed between a triangle and the exact surface. It is applied in the linear and both modes. By default, the value is 0.0005 in linear mode and 0.01 in both mode.

5

--tess-angular-tolerance

Specifies the angular tolerance for tessellation, in degrees, i.e. the maximum angle allowed between adjacent triangles. The value must be greater than 0 and not more than 180. It is applied in the angular and both modes. By default, the value is 10 in angular mode and 30 in both mode.

6

--ignore-transparency

Helps to ignore the transparency. By default, the value is false.

7

--log-file-path

Helps user to provide VMoveCAD log file path.

8

--units

Allows user to change the units of the CAD model. Available options are milli-meter, meter, feet, inch, and centimeter

9

--detailed-log

Writes more log information for debugging purpose. The per-body tessellation tolerance in force is also written to the log.

10

--export-surface

Allows user to write the surface geometry into CAX. This option is enabled by default.

11

--export-lines

Allows user to write the lines and curves into CAX. This option is enabled by default.

12

--export-pointset

Allows user to write the pointset into CAX

13

--model-file-format

Allows user to specify the model file format instead of application deriving from the file extension

14

--filter-file-path

Allows users to exclude specific sub-assemblies from being exported to CAX. The sub-assembly names must be listed in a text file, and file path should be provided through this argument

Tessellation Tolerance

VMoveCADBatch converts the B-Rep surfaces of the CAD model into triangles. Two independent criteria control how fine this mesh is:

  • Linear (sag) tolerance is the maximum distance allowed between a triangle and the exact surface. Smaller values give a denser and more accurate mesh. The value is relative to the size of each body (a fraction of its bounding box diagonal), so the same value gives comparable results on small and large models.

  • Angular tolerance is the maximum angle, in degrees, allowed between adjacent triangles. Smaller values give a denser mesh on curved surfaces, independent of their size.

The --tess-tolerance-mode option selects which of these criteria are applied. When both are applied, the tessellator refines until each criterion is satisfied, so the finer one wins locally. For this reason the both mode uses looser defaults for each criterion than the modes that use one criterion alone.

Mode

Linear

Angular

How to select

linear

0.0005

not applied

Default. Also selected by --tess-tolerance-mode=linear

angular

not applied

10 degrees

--tess-tolerance-mode=angular, or --tess-angular-tolerance given without a mode

both

0.01

30 degrees

--tess-tolerance-mode=both

A tolerance value given on the command line always wins over the mode default; the mode only fills in the values that were not given. Hence the mode on its own is a complete instruction, and no value needs to be passed.

An explicit --tess-tolerance-mode always decides which criteria are applied. Without it, passing --tess-angular-tolerance switches the translation to the angular mode, which is how earlier releases behaved.

The tolerance options have no effect on CAD files that carry their own tessellation (for example, CATIA V5 files). In that case the stored mesh is reused as is, and the log file records this once per run.

If --tess-tolerance-mode is given any value other than linear, angular or both, VMoveCADBatch stops with error code 9. A non-numeric --tess-tolerance or --tess-angular-tolerance value, or an angular value outside the range 0 to 180, is reported as an argument error.

Examples

VMoveCADBatch.exe --dir cad_files cax_files

The above example converts all the CAD models from the cad_files folder into CAX files in the cax_files folder.

VMoveCADBatch.exe -- dir --output-format="cgr" cad_files cgr_files

The above example converts all the CAD models from the cad_files folder into CGR files in the cgr_files folder.

VMoveCADBatch.exe --tess-tolerance="0.002" part2.catpart part2.cax

The above example converts the part2.catpart into part2.cax with a linear tolerance of 0.002 in the default linear mode. A larger value than the default 0.0005 reduces the number of triangles in the model as well as the file size of the cax file; a smaller value gives a more accurate mesh.

VMoveCADBatch.exe --tess-tolerance-mode="angular" part2.catpart part2.cax

The above example tessellates the part2.catpart using only the angular tolerance, with its default value of 10 degrees. The linear tolerance is not applied.

VMoveCADBatch.exe --tess-angular-tolerance="25" part2.catpart part2.cax

The above example tessellates the part2.catpart using only the angular tolerance, set to 25 degrees. Since no --tess-tolerance-mode is given, passing the angular tolerance alone selects the angular mode.

VMoveCADBatch.exe --tess-tolerance-mode="both" part2.catpart part2.cax

The above example applies both criteria with their defaults for this mode, a linear tolerance of 0.01 and an angular tolerance of 30 degrees.

VMoveCADBatch.exe --tess-tolerance-mode="both" --tess-tolerance="0.002" --tess-angular-tolerance="12" part2.catpart part2.cax

The above example applies both criteria with explicit values, a linear tolerance of 0.002 and an angular tolerance of 12 degrees. Values given on the command line replace the mode defaults.

VMoveCADBatch.exe --ignore-transparency part2.catpart part2.cax

The above example converts the part2.catpart into part2.cax , in which the transparency of CAD model is ignored.

VMoveCADBatch.exe--log-file-path="c:logfilesVMoveCADlog.txt" part2.catpart part2.cax

The above example converts the part2.catpart into part2.cax and writes the log file in the specified path.

VMoveCADBatch.exe --units="Inch" part2.catpart part2.cax

The above example converts the part2.catpart into part2.cax with the unit system as Inch.

VMoveCADBatch.exe --detailed-log part2.catpart part2.cax

The above option lets the application write more log information.

VMoveCADBatch.exe --export-surface part2.catpart part2.cax

The above option lets the application write mesh into cax file. The surface geometry can be ignored in CAX file by providing the option --export-surface=false

VMoveCADBatch.exe --export-lines part2.catpart part2.cax

The above option lets the application write 2D Elements into cax file. The lines and curves can be ignored in CAX file by providing the option --export-lines=false

VMoveCADBatch.exe --export-pointset part2.catpart part2.cax

The above option lets the application write the pointset into cax file. The points can be ignored in CAX file by providing the option --export-pointset=false

VMoveCADBatch.exe --model-file-format="parasolid_xmt" test.xmt_txt test.cax

The above option lets the user define the model file format. Here 'parasolid_xmt' lets the application understand that the test.xmt_txt is the parasolid format.

VMoveCADBatch.exe --filter-file-path=d:\filter.txt part2.catpart part2.cax

The above option lets the user pass the filter file path. The filter file format is as follows

*ASSEMBLIES
- *bolt*, FILTER
- Board, FILTER

Here, the sub-assembly 'Board' and all sub-assembly names that contain 'bolt' will be excluded from being exported to CAX

Notes:

  1. It is mandatory to enclose the input and output in quotes (" ") when it involves spaces. The quotes can be avoided if no spaces are involved. However, we always advise the users to make a practice of using quotes always.

  2. The options are case insensitive.

Error Codes

VMoveCADBatch returns one of the following error codes.

Error Code

Description

0

Cax is generated successfully.

1

Unexpected error.

2

Read/Write permission is not available.

3

Unsupported input/output file extension.

4

Unsupported CAD file version

5

VMoveCAD license is not available.

6

Out of Memory

9

Invalid arguments

10

Reader API error.

11

Writer API error.

12

Unable to create log file