Launching a Check Correction Method

You can create checks containing a correction method to make the invalid features fulfill the check. The correction method can be written in Knowledge Language or Visual Basic.

Note: This correction method is available only if you selected the Knowledge Language when writing the check body.


Before you begin: Import and open the 3dxml file located in KnowHowUIRuntime\CNext\startup\Knowledgeware\QCC samples\Sample001.
See Also
Creating an Expert Check
  1. In the Update Status frame, select the Deactivated check box and click OK.
  2. From the Compass:
    1. Click the 3D Modeling Apps and select Quality Rules Reuse.
    2. Select Expert Check and enter a check name and a comment in the dialog box.
    3. Click OK.
    The Expert Check Editor appears.
  3. Enter the dim statement in the Name area to specify that the check is to be applied to all dimensions. To do so:
    1. Double-click Add new argument and enter dim.
    2. Select the TPSDimensionAnnot type in the Type list.
  4. Copy and paste the following script in the text editor: dim.DimensionType == "DrwDimDistance" => dim.Name->Search("Prefix", 0, TRUE) == 0.
    Note: To know more about the => operator, see Languages in Quality Rules Reuse and Quality Rules Capture.
  5. Select the Correction tab, then from the list select Knowledge Language. Type the following script in the editor: dim.Name = "Prefix" + dim.Name.
    Notes:
    • There is no syntax verification in the Correction tab. To check your syntax, do the following:
      • Copy your script in a rule.
      • Click Apply to check the syntax.
      • Copy the script in the correction editor.
    • Several options are available:
      • Visual Basic Language lets you write a correction script in VB.
      • Advise Correction allows displaying a message each time you use the correction method.
      • URL opens a web browser to display the URL link you add.
    • Use the same variable name as the arguments in the Condition tab (dim in our example).
  6. Select the Report tab and enter the text below in the Help Message box:
    Check that all linear annotations name have the "Prefix" prefix.
  7. Click OK to add the check to the rule base, then click Solve to solve the rule base.
    In the tree, the check icon is red indicating that not all annotations have the right prefix.
  8. Right-click Check.xxx and select Check.xxx object > Correct function.
    In the tree, the check icon is green indicating that all annotations have the right prefix.