<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%measure_minimum_dist</TITLE><H1>%measure_minimum_dist  </H1><P CLASS="Paragraph">Classname: <B>%measure_minimum_dist  </B></P><P CLASS="Paragraph">Inherits from: <B><A href=..\checkmate\xug_base_checker.html>%ug_base_checker </A></B></P><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"> </PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">
<B>Description:</B>
      This checker validates the minimum distance between two UG geometry objects, which
      can be selected by through the class selection dialog under the Customization dialog.
      The system reports the results back based on the specified range.
      The specified range is defined by the following criteria:
            (1) Any value satisfy the specified minimum distance will pass.
            (2) Any value between the minimum and maximum distance ranges is
                marginal (pass with warning).
            (3) Any value violates the minimum range fails.
Parameters:
    ( List )     geom_objects
                        - List of two geometric objects to be measured
    ( List )     pass_range
                     -  Minimum distance range to pass (in millimeter)
                        Each range bound has two members.  The first member
                        defines the condition which can be LT, LE, GT or GE keyword.
                        LT is "less than". LE is "less than or equal to".
                        GT is "greater than". GE is "greater than or equal to".
                        The second member is integer or real value for the
                        range limit. For example, {{GT, 0.0}, {LE, 1.0}} or {{LE, -1}}.
                        If a range list has two limits, then the first limit defines the lower
                        limit; the second limit defines the upper limit. Otherwise, the checker
                        will return an invalid range error.
    ( List )    Marginal_range (in millimeter)
                     -  A list of one or two range limits for the marginal range criterion
    ( List )    Fail_range (in millimeter)
                     -  A list of one or two range limits for the failure range criterion
    ( String )  error_message
                     - error message
    ( String )  warning_message
                     - warning message
    ( Boolean ) disabled?        -  If it is true, the checker is disabled.
                                     Default is False.
    ( Boolean ) save_log_in_part -  The flag indicates whether the checking results can
                                     be saved to the part file
                                     Default is True.
Results:
      PASS         -- The measured distance passes the checking criteria.
      WARNING      -- The measured distance is marginal against the minimum and maximum ranges.
      FAIL         -- The measured distance fails the checking criteria.
UG Objects logged: Two selected ug geometry objects.
</PRE><PRE><FONT COLOR= blue>DefClass: %measure_minimum_dist ( %ug_base_checker ); 
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )    %test_category: "Template.Measurement";
   ( String )    %displayed_name: "Check Minimum Distance Range";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( Boolean Parameter )    Disabled?: False;
   ( Boolean Parameter )    save_log_in_part: True;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">   Attributes for this class</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )           geom_objects_label: "Two Geometric Objects";
   ( List )             geom_objects_mask: {face, edge, curve, all};
   ( List )             geom_objects_mode: {};

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )           fail_range_label: "Fail Range (mm)";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )           pass_range_label: "Pass Range (mm)";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )           marginal_range_label: "Marginal Range (mm):";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List Parameter )   geom_objects: {};
   ( List Parameter )   fail_range:       {{LT, 0.0}, {GT, 0.20}};
   ( List Parameter )   pass_range:       {{GE, 0.01}, {LE, 0.1}};
   ( List Parameter )   marginal_range:       {{GE, 0.11}, {LE, 0.19}};
   ( String Parameter )   error_msg: "The measured minimum distance falls in failure range.";
   ( String Parameter )   warning_msg: "The measured minimum distance falls marginal range.";
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">   Checker function</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   (Any Uncached)   do_check: 
      if (Empty?(pass_range:) & Empty?(fail_range:) & Empty?(marginal_range:) )
      then
            ug_mqc_empty_param_warning()
      else
      @{
                  $count << length(geom_objects:);
                  if ( $count > 0 & mqc_is_valid_object_identifier( nth(1, geom_objects:) ) ) 
                  then       
                      mqc_measure_min_dist (geom_objects:, 
                                            pass_range:, 
                                            marginal_range:,
                                            fail_range:,
                                            error_msg:, 
                                            warning_msg:)
                  else
                  @{
                        $msg << "Fail to check due to invalid geometry objects.";   
                        ug_mqc_log(LOG_ERROR, {}, $msg); 
                  }; 
                              
      };

</SPAN></FONT></PRE></DIV></TABLE><p class=EndLine>&nbsp;</p><p class=blank>&nbsp;</p></BODY></HTML>