<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_report_entities_with_filters</TITLE><H1>%mqc_report_entities_with_filters </H1><P CLASS="Paragraph">Classname: <B>%mqc_report_entities_with_filters </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>
    Report entities with the specified types, layers/categories and colors.
Parameters:
    ( List )  entities              - This parameter is used to display filter
                                      option button in checker customization dialog.
    ( Name )  entities_type_mode    - This parameter is used to set entity type
                                      filter mode which can be Include or Exclude.
                                      Include - Collect entities with the specified
                                                types in the list filter_type_filter.
                                      Exclude - Collect entities without the specified
                                                types in the list filter_type_filter.
                                      Default is Include.
    ( List )  entities_type_filter  - This parameter is used to collect the entity
                                      types for entity type filter.
                                      It can be a list of any entity types available
                                      in the class selection dialog.
                                      Default is
                                      {All_Curves,Spline,Arc,Line,Conic,
                                       Ellipse,Hyperbola,Parabola};
    ( Name )  entities_layer_mode   - This parameter is used to set layer filter mode
                                      which can be Include or Exclude.
                                      See filter_type_mode.
                                      Default is Include.
    ( List )  entities_layer_filter - This Parameter is used to collect the layers
                                      for layer filter.
                                      It can be a list of layers string or category
                                      name string, For example: {"8,10-12", "SOLID"}
                                      Default is {ALL}.
    ( Name )  entities_color_mode   - This parameter is used to set color filter mode
                                      which can be Include or Exclude.
                                      See filter_type_mode.
                                      Default is Include.
    ( List )  entities_color_filter - This parameter is used to collect the colors
                                      for color filter.
                                      It can be a list of color RGB,
                                      such as {{255,0,0},{102,102,102}},
                                      or color index, such as {1,2,3}
                                      Default is {ALL}.
    (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.
    (String)   log_msg          -  User defined message to be added when the system
                                   reports the violation.
                                   Default is an empty string.
Results:
    Info -  Report entities with the specified types and reside on
            the specified layers and in the specified color.
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_report_entities_with_filters( %ug_base_checker );
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )    %test_category:  "Get Information.Modeling";
   ( String )    %displayed_name: "Report Entities with Specified Filters";
</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 )            entities_label: "Entity Filter";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List Parameter )    entities: {};
   ( Name Parameter )    entities_type_mode: Include;
   ( List Parameter )    entities_type_filter: {all};
   ( Name Parameter )    entities_layer_mode: Include;
   ( List Parameter )    entities_layer_filter: {all};
   ( Name Parameter )    entities_color_mode: Include;
   ( List Parameter )    entities_color_filter: {all};
   ( String Parameter )  log_msg: "";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )            log_msg_label: "Log Message";

   (Any Uncached)   do_check:
   @{
       $usr_msg << If ( "" = log_msg: ) Then "" Else "~n"+log_msg:;

       #Build filter condition string       
       $type_str  << If ( (entities_type_mode: = Include) & Member(All,entities_type_filter:))
                     Then ""
                     Else If ( entities_type_mode: = Include )
                     Then "    Types: Include "+mqc_list_to_string(entities_type_filter:,",")+"~n"
                     Else "    Types: Exclude "+mqc_list_to_string(entities_type_filter:,",")+"~n";
                            
       $layer_str << If ( (entities_layer_mode: = Include) & Member(All,entities_layer_filter:) )
                     Then ""
                     Else If ( entities_layer_mode: = Include )
                     Then "    Layer/Category: Include "+mqc_list_to_string(entities_layer_filter:,",")+"~n"
                     Else "    Layer/Category: Exclude "+mqc_list_to_string(entities_layer_filter:,",")+"~n";

       $color_str << If ( (entities_color_mode: = Include) & Member(All,entities_color_filter:) )
                     Then ""
                     Else If ( entities_color_mode: = Include )
                     Then "    Colors: Include "+mqc_list_to_string(entities_color_filter:,",")+"~n"
                     Else "    Colors: Exclude "+mqc_list_to_string(entities_color_filter:,",")+"~n";

       #Get all entities with specified type and layer and color.
       $specified_entities  << mqc_collectEntitiesWithFilterOptions( 
                                 entities_type_mode:,  entities_type_filter:,
                                 entities_layer_mode:, entities_layer_filter:,
                                 entities_color_mode:, entities_color_filter: );

       #Build detail log message.
       $entities_num  << Length( $specified_entities );
       
       $entities_num_str << If( $entities_num = 0 )
                            Then "No specified entity found"
                            Else If ( $entities_num = 1 )
                            Then "Found one specified entity"
                            Else "Found "+stringvalue($entities_num)+" entities";
                            
                                
       $detail_msg  << If ( ($type_str = "") & ($layer_str = "") & ($color_str = "") )
                       Then $entities_num_str
                            +" in part.~n"
       
                       Else $entities_num_str
                            +" with following filters:~n"
                            +$type_str 
                            +$layer_str 
                            +$color_str;

       #Log these entities.
       ug_mqc_log( LOG_INFO, $specified_entities, $usr_msg + $detail_msg  );
   };

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