Handling block groups in beveling rules
Bevel norms and beveling settings, including weld and beveling rules, have a central location in the project norms, <project>\norms\cvar\weld. The files here are used to store System Management settings, or they are called from various macros or program code.
Note: These files were relocated to the current location in the 2021T2 release of CADMATIC Hull. Previously they were located in the active norms folder %ncgnorms%, and it was possible to have several of these norms folders in a project. Now all the weld and beveling related settings and norms files are located in a single location and are used throughout the complete project. When a project created with a Hull version earlier than 2021T2 is opened in Hull 2021T2 and later, the system automatically copies the files from the norms folder that is the most used by block groups to the new location.
In situations where blocks for the same ship are produced at different facilities using different settings and norms, it is possible to make own weld and beveling rules for different block groups. The blockgroup variable can be used to compose rules that apply to parts in blocks that belong to a specific block group. This way all the rule files can be stored in the same location.
Using the blockgroup variable
The blockgroup variable can be used in weld and beveling rules together with equality operators == and != (equal, not equal) to determine whether a part is located in a block that belongs to a particular block group.
Postfixes _1 and _2 can be used in cases where the rule must handle two parts. Variable blockgroup_1 is then used for the first part and blockgroup_2 for the second part.
blockgroup is a string variable that holds the block group name, Hull for example.
Example
In the following example, if the first part is in a block that belongs to block group Hull, the system continues to parse rule file pdbrule1000.cfg (a plate beveling rule). This rule would contain settings for block group name Hull. Otherwise, the system continues to parse rule file pdbrule2000.cfg which would contain settings for block groups other than Hull.
blockgroup_1=="Hull" $ pdbrule1000
blockgroup_1!="Hull" $ pdbrule2000
Note: The variable value (Hull in the example) is case sensitive.
Using comparison functions
Comparison functions can be used check the block group of the part against a specific block group name. The block group of the part and the specific block group name are used as the arguments of the comparison function. Based on the result of the comparison, the system can be directed to apply a certain rule for that part. With comparison functions it is possible to use case-insensitive variable values for blockgroup, and use wildcards in the value.
The comparison functions are:
-
strcmp (case sensitive comparison)
-
stricmp (case insensitive comparison)
-
wldcmp (wildcard comparison)
For strcmp and stricmp the result is an integer value which is either <0, 0 or >0. The result indicates whether the part is located in a block that belongs to the specified block group, as follows:
-
Smaller and greater than values indicate that the part is not located in a block that belongs to the specified block group.
-
Zero indicates that the part is located in the block belongs to the block group.
The result can then be followed with equality operators == and !=, and based on the result (equal or not), direct the system to use a certain rule.
The wldcmp function can be used for comparing using wildcards. Note that the return value for this function is boolean true or false, and the equality operators following the result are not required.
Examples of using stricmp
In the following example, if the first part is in a block that belongs to block group Hull, the comparison function returns value 0. In that case, because of the equality operator ==, the system would continue to parse rule file pdbrule1000.cfg (a plate beveling rule). This rule would contain settings for block group name Hull. Otherwise, the system would continue to parse rule file pdbrule2000.cfg which would contain settings for block groups other than Hull.
stricmp(blockgroup_1,"Hull")==0 $ pdbrule1000
stricmp(blockgroup_1,"Hull")!=0 $ pdbrule2000
Example of using wldcmp
In the following example, we assume that block groups HullA, HullB and HullC exist. The following line checks whether the part is in a block group starting with "Hull". The function returns either true or false. If true, the system continues to parse rule file pdbrule1000.cfg which would contain settings for block groups HullA, HullB and HullC.
wldcmp(blockgroup_1,"Hull*") $ pdbrule1000