Creating an Expert Rule

You can create expert rules which are sets of instructions generally based on conditional statements, where the relationship between parameters is controlled. In the task below, you create an expert rule which replaces any hole that has a 50mm diameter by a hole that has a diameter of 10mm.

See Also
Editing an Expert Rule
About Expert Rules
  1. From the Compass, click the 3D Modeling Apps quadrant, and select Quality Rules Reuse.
  2. From the Quality Rules Reuse section, select Expert Rule .
    If need be, replace the default name and description for the rule to be created.
  3. Select Knowledge Language and click OK.
    The Expert Rule Editor appears.
    Important: If you want to select the Check Language after creating the check, right-click the check in the tree, and select Properties or Alt > Enter.
  4. Enter H:Hole in the For All ( ) area to specify that the rule is to be applied to all the holes and that H is used as a variable. To do so:
    1. Double-click Add new argument and enter H.
    2. Select the Hole type from the Type list.
    3. Click Apply.
  5. Copy/Paste the rule below from your browser to the editor:

    if (H.Diameter == 50.0 mm) 
           H.Diameter = 10.0 mm  
    else 
           H.Diameter = 20.0 mm

    Important:
    • The editor supports the auto-completion that allows you to access available variables, knowledge types or methods (for example, when you declare a new variable, the list of available known Knowledge types automatically displays).
    • You can use the following keyboard shortcuts in the editor:
      • Ctrl+Z: Undo. Lets you delete the last word you entered.
      • Ctrl+Y: Redo.
      • Ctrl+F: Search in text.
      • Ctrl+A: Select all.
  6. Select Apply to test the syntax.
  7. Click OK.
    A rule is added to the rule set in the tree.
  8. Select Solve to solve the rule base. If need be, update the document.