Rule configuration files

Rules are used for automatically processing construction parts in specified situations. A rule consists of a condition followed by an answer. The answer is an action that the system performs if the condition is met (true).

Conditions and answers are expressed as variables and their values (constants), as well as functions and operators. See Variables and constants (rules) and Functions and operators.

Rules are contained in rule configuration files (.cfg). Some of the configuration files must be created and modified in a text editor. Rules for some functions can be created in the System Management application. See Defining rules in System Management for more information.

Rule configuration files for the following functions and purposes can be defined:

  • Predefined bevels that the system applies to plate connections. See Plate beveling rules.

    • File naming – pdbrule0000.cfg, pdbrule0100.cfg, pdbrule0200.cfg, and pdbrule0300.cfg. See Rules for specific connection types.

    • File location – \norms\cvar\weld subfolder of the project's norms folder %ncgnorms%

  • Predefined bevels that the system applies to profiles and their end shapes See Profile beveling rules.

    • File naming – profilepdb<number>.cfg, where number is a four digit integer ranging from 0001 to 9999.

    • File location – weld subfolder of the project's norms folder %ncgnorms% (<project>\norms\cvar\weld for centralized norms)

  • Returning values based on the logistical properties of the parts to be used in for example reports and part labels.

    • File naming – rule<number>.cfg, where rnumber is a four digit integer ranging from 0001 to 9999.

    • File location – logistics subfolder of the norms\cvar folder

  • Logistical color filter scheme for Hull Viewer. See Logistical color filter rules.

    • File naming – logcol<number>.cfg, where number is a four digit integer ranging from 0001 to 9999.

    • File location – project's norms folder %ncgnorms%

  • Logistical Color rules for elongation reports

    • File naming – elocol<number>.cfg and eloext<number>.cfg, where color_rule_number is a four digit integer ranging from 0001 to 9999.

    • File location – the norms/cvar folder of the project

  • Weld side rules

  • Weld factor rules

Syntax of a rule configuration file

Example syntax (logcol0001.cfg):

Thickness // Description
thickness<10 $ RGB(255,0,0) // Expression 1
thickness>=10 and thickness<20 $ RGB(0,255,0) // Expression 2
thickness>=20 $ RGB(0,0,255) // Expression 2 
RGB(0,0,0) // Default answer

  • First line is the description.
  • Last line is the default answer.
  • All other lines have the syntax <condition> $ <answer>. $ symbol or ☺ character (ALT+1) must be used as separator character.
  • These lines are evaluated from the top until one evaluates to TRUE.
  • The answer on that line is returned.
  • If none of the expressions evaluate to TRUE, the default answer is returned.

The answer of an evaluated line can also be the answer of another rule, for example: thickness>=10 and thickness<20 $ rule0021.

A maximum of 16 levels of rule nesting is possible.

The answer can be formatted. See Field Format Editor for information on the format codes.

Functions, operators, variables and constants

For information on the functions, operators, variables and constants that the rule parser recognizes and can be used within the rule system, see the following help topics: