<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%measure_curve_arc_length</TITLE><H1>%measure_curve_arc_length  </H1><P CLASS="Paragraph">Classname: <B>%measure_curve_arc_length  </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 provides a function that measures the arc length of a
    UG curve object and compares the arc length with the specified ranges.
Parameters:
    ( List )    curve: {};         - Target curve or edge to be evaluated
    ( Number )  start_parm: 0.0;   - Start parameter
    ( Number )  end_parm: 1.0;     - End parameter
    ( Name )    check range unit   - mm or inches
    ( List )    pass_range:        - A list of one or two range limits for the pass range
                                     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:    - A list of one or two range limits for the marginal range
    ( List )    fail_range:        - A list of one or two range limits for the failure range
    ( String )  error_message - error message to be logged
    ( String )  warning_message - warning message to belogged
    (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 arc length passes the specified pass range.
    WARNING      -- The arc length is located within the marginal range.
    FAIL         -- The arc length is located within the failure range.
UG Objects logged:
    none
</PRE><PRE><FONT COLOR= blue>DefClass: %measure_curve_arc_length ( %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 Arc Length 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 )           curve_label: "Curve/Edge to be Checked";
   ( List )             curve_mask: {edge, curve};
   ( List )             curve_mode: {};

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )           unit_label: "Range Unit";
   ( List )             unit_option: {mm, inches};

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

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

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

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List Parameter )   curve: {};
   ( Number Parameter ) start_parm: 0.0;
   ( String )           start_parm_label: "Start Parameter";
   ( Number Parameter ) end_parm: 1.0;
   ( String )           end_parm_label: "End Parameter";
   ( Name Parameter )   unit: mm;
   ( List Parameter )   pass_range: {{GE, 0.01}, {LE, 0.1}};
   ( List Parameter )   marginal_range: {{GE, 0.11}, {LE, 0.19}};
   ( List Parameter )   fail_range: { {LT, 0.0}, {GT, 0.20}};
   ( String Parameter ) error_message: "Found curve that fails the arc length criteria.";
   ( String Parameter ) warning_message: "Found curve that violates the marginal range criteria.";
</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>   ( List )             parm_list:    {start_parm:, end_parm:};
 
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   (Any Uncached)   do_check: 
      if ( length(curve:) > 0 & mqc_is_valid_object_identifier ( nth(1, curve:) ) = false ) then
      @{
            $msg << "Error in checking due to invalid curve geometry.";
            ug_mqc_log(LOG_ERROR, {}, $msg);  
      }  
      else 
      @{
            if ( Empty?(pass_range:) & Empty?(fail_range:) & Empty?(marginal_range:) )
            then
                  ug_mqc_empty_param_warning()
            else
            @{   
                  $status << mqc_validate_3ranges(pass_range:, marginal_range:, fail_range:); 
                       
                  if ( -Empty?( curve: ) & ($status = false)) then 
                  @{ 
                        $len << ug_curve_askArcLength(ug_refObject(nth(1, curve:), ""), 
                                                                        parm_list: ); 
                                                            
                        $part_unit << ug_askPartUnits( "" ); 
                        $arc_length << if (unit: = mm) then 
                                          @{ 
                                                if ($part_unit = pounds_and_inches) then 
                                                $len*25.4
                                                else $len; 
                                          } 
                                          else 
                                          @{ 
                                                if ($part_unit = grams_and_millimeters) then 
                                                $len/25.4
                                                else $len; 
                                          };  
                      
                        $unit_string << makestring(unit:);
                     
                        $result << mqc_check_range($arc_length, marginal_range:); 
                        if $result = True then 
                                    @{ 
                                    $msg << warning_message: + "The arc length is " + 
                                                format("%f"; $arc_length)+ " " + $unit_string +".";  
                                    ug_mqc_log(LOG_WARNING, {}, $msg); 
                                    }     
                        else do_nothing; 
             
                        $result << mqc_check_range($arc_length, fail_range:);                          
                        if $result = True then 
                                    @{ 
                                    $msg << error_message: + "The arc length is " +
                                                format("%f"; $arc_length)+ " " + $unit_string +".";  
                                    ug_mqc_log(LOG_ERROR, {}, $msg); 
                                    } 
                        else do_nothing;                       
                  } 
                  else 
                  @{
                        $msg << "Error in checking due to invalid range specification.";
                        ug_mqc_log(LOG_ERROR, {}, $msg);  
                  };
            };
      };

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