Class name rules

You may want to instantiate different classes (child rules) based on logic. For example, based on design criteria, a support strut could be rectangular or cylindrical in shape. In such a case, Knowledge Fusion allows you to instantiate ug_block or ug_cylinder based on the input. you can accomplish this by applying a rule on class names. In Knowledge Fusion syntax, a rule can be applied on a class as follows:

(String Parameter Modifiable) type:  "Rectangular" ;
(child) Strut: { class, if type: = "rectangular" then ug_block
else ug_cylinder, Length, 10, Height, 10, Diameter, 10, Width, 10};

You can also expand the conditional to use else If to instantiate more than two classes. In such cases, you must provide the necessary canonical attributes of all the possible instantiable classes.

NullDesign Class

There may be cases when you want to instantiate a class only if required by the design intent and not otherwise. To do this, use the nulldesign class which does not instantiate any class. This is shown below:

(Boolean Parameter Modifiable) support?:  True ;
(child) Strut: { class, if support? = True then ug_block
else NullDesign, Length, 10, Height, 10, Width, 10};

A characteristic of the NullDesign class is that when a child rule gets updated to a non-null class from NullDesign, then geometry gets created at the end of the feature creation sequence. In large scale applications, keep this in mind while developing Knowledge Fusion Programs. This aspect of NullDesign is discussed in more details in the Special Topic Updating Null Design to Other classes. Put a link to 'Updating Null Design to Other classes