Handling Errors

You can handle errors when working with GSD features in Relations. In the scenario described below, you are going to create a representation containing two parallel lines and a datum point. This point is the intersection of the lines if they intersect, or the origin if they do not. To do so, you are going to create a rule.

  1. Create a document containing two parallel lines and a datum point.
  2. From the Compass, click3D Modeling Apps , and select Engineering Rules Capture.
  3. Click Rule to create a rule designed to react to the fact that the datum point is the intersection of the two lines if they intersect or the origin if they do not.
  4. In the editor, enter the following body:
    let x(Point)
    x=intersect ('Geometrical Set.1\Line.1', 'Geometrical Set.1\Line.3')
    if (x.Error == true)
    'Geometrical Set.1\Point.5' = point(0mm, 0mm,0mm)
    else
    'Geometrical Set.1\Point.5' = x
  5. Click OK when done. The intersect operator launches an error message if the intersection is empty.
  6. Right-click the rule in the tree and select Properties.
  7. Select the Do not catch evaluation errors check box and click OK when done. This way, the evaluation of the rule is forced even if an error occurs.
    Note: Using geometrical operators to value geometry in relations may lead to update errors in the created features. If you value a datum point with the result of the intersection of two lines, these two lines may not intersect and the point is therefore in error.

    Do not catch evaluation errors is available by selecting the relation in the tree and selecting the Properties command enables you to:

    • Create features in error
    • Know (through an error message) if a feature is in error
    • Make changes (or not) in case of errors.
    Note: This error handling is only available for GSD features.