Accessing the Expert Check in the Check Body  

atarget.gif (1372 bytes) The task described below explains how to access the check itself in the check body by using  the "Thischeck" variable.
"Thischeck" and "Thisrule" are variables created to help you write rules and checks. These 2 variables enable you to automatically reference the check or the rule you are working with. It enables you to:
  • Access the parameters located below the rule or the check (see scenario below),
  • Compare various elements.
ascenari.gif (1364 bytes)
  1. Create a pad containing holes or open the KwxThisCheck.CATPart file.

  2. Create a parameter of Length type (Length.1) and set its value to 15mm.

  3. Access the Knowledge Expert workbench and click the Expert Check icon (kwxWKChecks.gif (1236 bytes)).

  4. Change the name of the Check (ExpertCheck in this scenario), select the KWE language (by default) and click OK. The Check Editor opens.

  5. In the Check Editor, enter the script indicated in the column "With the ThisCheck method" (see table below). Click OK.

This script enables you to check that the diameters of the holes contained in this CATPart file are superior to 15 mm.
With the ThisCheck method Without the ThisCheck method
For all field:  P:Hole

P.Diameter > ThisCheck > GetAttributeReal
("Length.1")

 

For all field:  P:Hole ; C1:KWECheck

C1.Name == "CATKWECheck.1" /*Indicate the name of the check*/
=>
P.Diameter > C1 > GetAttributeReal ("Length.1")

  1. Click the Solve icon (). The rule set lights turn to green indicating that the check could be run correctly.

  2. Click here to display the result of the scenario.

aendtask.gif (1477 bytes)