<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_report_solid_body_with_specified_density</TITLE><H1>%mqc_report_solid_body_with_specified_density </H1><P CLASS="Paragraph">Classname: <B>%mqc_report_solid_body_with_specified_density </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 the solid bodies with customer specified density setting.
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.
    (String)   log_msg          -  User defined message to be added when the system
                                   reports the violation.
                                   Default is an empty string.
Results:
    INFO  --  Report the number of solid body with specified density setting.
              Case 1: If the part has no solid body.
                     "This part has no solid body."
              Case 2: If the part has any solid body that has specified density.
                     "Found XX solid bodies with specified density setting"
                      Log solid body tags
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_report_solid_body_with_specified_density( %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 Solid Body with Specified Density Setting";

</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;
   ( 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";

 # checking ...
   ( Any Uncached )   do_check:

   @{
  #     $solid_bodies << ug_mqc_ask_entities( SOLID_BODY );   
        $solid_bodies << mqc_askObjectOfType( FALSE, 70, 0 );

        $bodies_num   << Length( $solid_bodies );

        If ( $bodies_num = 0 )
        
        Then ug_mqc_log( LOG_INFO, {}, "This part has no solid body." )

        Else
        @{
            $default_density << mqc_askDefaultDensity2();
            $def_dens_number << First ( $default_density );
            $def_dens_unit   << Second( $default_density );

            #@<DEL>@
            #+
            The second parameter is "density units type",
            = 1    -    (lb/ cu in)
            = 2    -    (lb/ cu ft)
            = 3    -    ( g/ cu cm)
            = 4    -    (kg/ cu m) [default]
            No matter what units, if density number is more than 0,
            the solid body must have density.
            #-
            #@<DEL>@
            $density_list << mqc_askSolidsDensity2( $solid_bodies, $def_dens_unit );

            $solids_with_specified_density << Loop
            {
                 With $solid_with_userdef_density  Is  {};
                 
                 For  $loop_i     From  1     To  $bodies_num;
                 For  $solid_body Is    Nth( $loop_i, $solid_bodies );
                 For  $body_dens  Is    Nth( $loop_i, $density_list );

                 If ( -(typename($body_dens)= name) & ( $body_dens >= 0 ) & (-( $body_dens = $def_dens_number ) ) )
                 Append { $solid_body };
            };

            $usr_msg    << If ( log_msg: = "" ) Then "" Else log_msg:+"~n";

            $detail_msg << "Found "+Stringvalue( Length($solids_with_specified_density) )+" "+
                           "solid body with user specified density setting";

            ug_mqc_log( LOG_INFO, $solids_with_specified_density, $usr_msg+$detail_msg );
        };
   };

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