<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_blend_chamfer_referencing</TITLE><H1>%mqc_check_blend_chamfer_referencing </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_blend_chamfer_referencing </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>
    Checks if edge-blend/chamfer features are referenced when positioning
    other features or creating sketch constrains.Lists all edge-blend/chamfer
    features that referenced by other features, and lists all features
    that reference these edge-blend/chamfer features in detail message,
    but only log the blend/chamfer features.
Parameters:
   ( 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.
   (Integer)  log_type  -  Indicate which logging type to use to report the violation.
                                     1 - LOG_ERROR,
                                     2 - LOG_WARNING,
                                     3 - LOG_INFO,
                                     Default is 1 to log error.
    (String)  log_msg  - User defined message to be added when the system reports the violation.
                                    Default is an empty string.
Results:
    Info   - This part has no EDGE-BLEND and CHAMFER features.
    Pass  - The edge-blend or chamfer features are not referenced when
             positioning other features.
    Failed - Edge-blend or chamfer feature are referenced when
             positioning other features.
             Log the Edge-blend or chamfer tag which is referenced
             by other features.
See also: %mqc_check_feats_ref_chamfer_blend
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_blend_chamfer_referencing( %ug_base_checker );
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )               %test_category:  "Modeling.Features";
   ( String )               %displayed_name: "Check Blend/Chamfer Referencing";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( list )                log_type_option: { LOG_ERROR, LOG_WARNING, LOG_INFO };
   ( string )              log_type_label: "Log Option";
 # parameter for log_message     
</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;
   ( Integer Parameter )   log_type: 1;
   ( string Parameter )    log_msg: "";
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"> checking ...</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( string )              log_msg_label: "Log Message";
   
   ( list )feature_type_list: { BLEND, CHAMFER };

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( Any Uncached )   do_check:

   If ( -Member( log_type:, { 1, 2, 3 } ) )

   Then ug_mqc_empty_param_warning()
   
   Else Loop
   {
        For $feature_type In feature_type_list:;
        
        For $feature_tags Is mqc_askFeatures(FEATURE_TYPE, $feature_type);
        
        For $feature_num  Is Length( $feature_tags );
        
        Do  If ( $feature_num = 0 )
            Then ug_mqc_log( LOG_INFO, {}, "This part has no "+Stringvalue($feature_type)+" feature." )
            Else donothing;
            
        For $suppress_feat Is mqc_askSuppressedFeatures();

        For $feat_with_children  Is  Loop
        {
            For $each_feature    In  $feature_tags;
            For $feat_children   Is  Loop
            {
                For $each_child In Second( mqc_askFeatureRelatives( $each_feature ) );
                If ( Find($each_child ,$suppress_feat)= NoValue )
                    Append { $each_child };
            };
            If  ( -Empty?($feat_children) )
            Append { $each_feature };
        };
        
        Do If ( Empty?( $feat_with_children ) )
           Then donothing
           Else
           @{
                #+ <HZM> on 26-Apr-2004 Fix PR4954707
                In order to let user know which feature references blend\chamfer feature,
                show blend\chamfer children in detail message but only log blend\chamfer tag.
                #-
                #+
                $feature_names << Loop
                {
                    With $feat_name  Is  {};
                    For  $each_feat  In  $feat_with_children;
                    For  $feat_name  Is  First( mqc_askFeatureNameAndType($each_feat) );
                    Append { $feat_name };
                };
                
                        $detail_msg << 
                "Total number of " + Stringvalue($feature_type) + " features: "+Stringvalue($feature_num)+".~n"+
                Stringvalue(Length($feat_with_children))+ " are referenced in feature positioning."+
                "~nThey are:"+
                "~n    "+mqc_list_to_string( $feature_names, "~n   " );
                #-

                $detail_msg << Loop
                {
                    With $msg  Is  "";
                    For  $each_feat  In  $feat_with_children;
                    For  $feat_name  Is  First( mqc_askFeatureNameAndType($each_feat) );
                    For  $its_child  Is  Loop
                    {
                          For $each_child In Second( mqc_askFeatureRelatives( $each_feat ) );
                          If ( Find($each_child ,$suppress_feat)= NoValue )
                                Append { $each_child };
          
                    };
                    For  $child_str  Is  Loop
                    {
                         With $name_str    Is  "";
                         For  $each_child  In  $its_child;
                         For  $child_name  Is  First( mqc_askFeatureNameAndType($each_child) );
                         For  $name_str    Is  $name_str+"~n      "+$child_name;
                         Return Is $name_str;
                    };
                    For  $msg  Is  $msg+"~n Feature "+$feat_name+" is referenced by:"+$child_str;
                    Return Is $msg;
                };

                $log_option << Nth( log_type:, log_type_option: );
                $usr_msg << If ( "" = log_msg: ) Then "" Else log_msg: + "~n";
                ug_mqc_log( $log_option, $feat_with_children, $usr_msg+$detail_msg );
           }; 
   };

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