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.

  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 .
  3. Select Knowledge Language and click OK.
    The Expert Rule Editor appears.
  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

  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.