×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Checkmate customization

Checkmate customization

Checkmate customization

(OP)
Hello all

I cannot find a way to make two inputs so first_input finds every blend less than the number put in and the second_input finds the every blend greater than the number put in. Does anyone know how to do this?

The code looks like:
If ( ( first_input: < 0.0 ) )
Then
@{
$log_msg << "Invalid values given to the parameters.~n"+
"The blend feature cannot be under 0.";
ug_mqc_log( LOG_WARNING, {}, $log_msg );
}
Else
@{


$all_feats_tags << mqc_askFeatures( checked_type );
$all_feats_types << mqc_askFeatureTypes( features_tags, $all_feats_tags );
$count_feats << ( $all_feats_types );

$blend_obj <<

Loop
{
For $each_feat in $count_feats;
For $feat_ra is mqc_askBlendRadius( $each_feat );
If( ($feat_ra > first_input) & ($feat_ra < $second_input))
Append {$each_feat};
}

if ( Empty?($blend_obj) )
then
@{
$detail_msg << mqc_sprintf("Found %s blend",
Format("%d", Length($blend_obj)));
$usr_msg << If ( "" = log_msg: ) Then "" Else log_msg: + "~n";
ug_mqc_log( Nth(log_type:, log_type_option:), $blend_obj, $usr_msg + $detail_msg);
}
else
donothing;

};

Best regards

Christian

RE: Checkmate customization

In KF I think each If statement must have both a Then and Else part. Your loop does not have a Then and Else after If statement.

Suresh
www.technisites.com.au

RE: Checkmate customization

(OP)
Thank you for you're answer! Helped with the problem at hand.

The mqc_askBlendRadius() but needs a integer, which integer can be used? becuase the one i used before does not work.

Regards
Christian

RE: Checkmate customization

The mqc_askBlendRadius() needs the tag of the blend. Look at the snippet below.

CODE

$feats << mqc_askFeaturesByType( "BLEND" ); 

$blend_feats << 
Loop 
{ 
For $each_feat in $feats; 
For $cur_blend_value is mqc_askBlendRadius( $each_feat ); 
If( your conditional statement ) 
Append {$each_feat}; 
}; 

Suresh
www.technisites.com.au

RE: Checkmate customization

(OP)
Thank you for your answer!
I get the error message from the Log file in NX:

CODE -->

&MACRO CUSTOM HEADER 25 "UGTL_macro" 0
&MACRO CUSTOM 25 MCT * TL_EXPAND * (4) * 1 ! Modeling
&MACRO CUSTOM 25 MCT * TL_EXPAND * (4 1) * 1 ! Features
&MACRO CUSTOM 25 MCT * TL_PICKED_ITEM * (4 1 1) * 0 ! Blend
&MACRO CUSTOM 25 MCT * TL_SELECT * (4 1 1) * 0 * 1 ! Blend
&MACRO CUSTOM 25 MCT * TL_DEFAULT_ACTION * (4 1 1) * 0 ! Blend
&MACRO EVENT ACTIVATE 0 0, 52, 0, 0, 0! Execute Check-Mate Tests
&MACRO ASK_ITEM 11 (1 OPTM 0) = 0  ! ##495None
&MACRO ASK_ITEM 26 (1 BOOL 0) = 0  ! Stop on an Error
&MACRO ASK_ITEM 27 (1 BOOL 0) = 0  ! Stop on a Warning
&MACRO ASK_ITEM 39 (1 BOOL 0) = 0  ! Generate an External Log File
&MACRO ASK_ITEM 40 (1 OPTM 0) = 0  ! One log per session
&MACRO ASK_ITEM 42 (1 STRN 0) = "C:\Siemens\NX11\UGII"  ! Directory
&MACRO ASK_ITEM 29 (1 OPTM 0) = 0  ! Do Not Save
&MACRO ASK_ITEM 30 (1 OPTM 0) = 0  ! Do Not Save
&MACRO ASK_ITEM 32 (0 BOOL 0) = 0  ! Generate Check Flag
&MACRO ASK_ITEM 33 (0 BOOL 0) = 1  ! Treat Warning as Pass
&MACRO ASK_ITEM 34 (1 BOOL 0) = 0  ! Skip Checking if Check Flag is Up-to-date
&MACRO ASK_ITEM 36 (0 BOOL 0) = 0  ! Read Flag without Part Loading
&MACRO ASK_ITEM 35 (1 BOOL 0) = 0  ! Skip Checking if Part has Overridden Results
&MACRO ASK_ITEM 11 (1 OPTM 0) = 0  ! ##495None
Symbol not found in dynamic module onFusionLoad
Bad eval return code 3270018 in checker '%mqc_check_blend'.&MACRO FOCUS CHANGE IN 1
&MACRO ASK_ITEM 4849664 (1 OPTM 8400) = 1  ! Saved in Part
&MACRO ASK_ITEM 4849664 (1 OPTM 8400) = 0  ! Most Recently Run
&MACRO ASK_ITEM 8847360 (1 BOOL 8400) = 0  !  
&MACRO ASK_ITEM 9175040 (1 BOOL 8400) = 0  !  
&MACRO ASK_ITEM 2621440 (1 OPTM 8400) = 0  !      
&MACRO CUSTOM HEADER 29 "HD3D_Node" 0
&MACRO CUSTOM 29 NX_VALIDATION_GADGET * TREE_TYPE * NODE_EXPAND * 1 * (0) ! model1.prt
&MACRO CUSTOM 29 NX_VALIDATION_GADGET * TREE_TYPE * NODE_SELECT * 2 * (0 0) ! Blend
&MACRO ASK_ITEM 2621440 (1 OPTM 8400) = 0  ! model1.prt
&MACRO CUSTOM 29 NX_VALIDATION_GADGET * TREE_TYPE * NODE_MENUPOPUP * 2 * (0 0) ! Blend 
What does this mean? Tried with different feature finders, but ended up with almost the same error code.

RE: Checkmate customization

Not sure what the problem is. Do you have Checkmate execute license?

Suresh
www.technisites.com.au

RE: Checkmate customization

(OP)
I only have the Author license

RE: Checkmate customization

If you post your complete checker code, I can test.

Suresh
www.technisites.com.au

RE: Checkmate customization

(OP)
Here is the DFA code:

CODE

#! NX/KF 3.0
#
 
DefClass: %mqc_check_blend1 ( %ug_base_checker );
   ( String )    %test_category: "Modeling.Features";
   ( String )    %displayed_name: "Blend1";
   ( Boolean Parameter )    Disabled?: False;
   ( Boolean  )    save_log_in_part: True;
 
#  Attributes for this class
   ( Number Parameter )   first_input: 2;
   ( String )   first_input_label: "First Number";
   ( Integer Parameter )   log_type: 1;
   ( List )   log_type_option: { LOG_ERROR, LOG_WARNING, LOG_INFO };
   ( String )   log_type_label: "Log Option";
   ( String Parameter )   log_msg: "";
   ( String )   log_msg_label: "Log Additional Message";
   ( List )   checked_type: { "BLEND" };
 
#  Checker function
   (Any Uncached)   do_check: 
   If ( ( first_input: < 0.0 ) )
   Then
   @{
           $log_msg << "Invalid values given to the parameters.~n"+
                       "The blend feature cannot be under 0.";
           ug_mqc_log( LOG_WARNING, {}, $log_msg );
     }
   Else
   @{
   	   $feats << mqc_askFeaturbyType( checked_type ); 

   	   $blend_obj << 
	   Loop { 
	       For $each_feat in $feats; 
	       For $blend_ra is mqc_askBlendRadius( $each_feat ); 
	       If( $blend_ra < first_input) 
	           Append {$each_feat}; 
                };

     if ( Empty?($blend_obj) )
          then
          @{
              $detail_msg << mqc_sprintf("Found %s blend",
                               Format("%d", Length($blend_obj)));

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

RE: Checkmate customization

Had a typo and syntax error. mqc_askFeaturbyType should be mqc_askFeaturesByType. Below is the code.

CODE -->

#! NX/KF 3.0
#
 
DefClass: check_blend1 ( %ug_base_checker );
   ( String )    %test_category: "TEST.My";
   ( String )    %displayed_name: "Blend1";
   ( Boolean Parameter )    Disabled?: False;
   ( Boolean  )    save_log_in_part: True;
 
#  Attributes for this class
   ( Number Parameter )   first_input: 2;
   ( String )   first_input_label: "First Number";
   ( Integer Parameter )   log_type: 1;
   ( List )   log_type_option: { LOG_ERROR, LOG_WARNING, LOG_INFO };
   ( String )   log_type_label: "Log Option";
   ( String Parameter )   log_msg: "";
   ( String )   log_msg_label: "Log Additional Message";

#  Checker function
   (Any Uncached)   do_check: 
   If ( ( first_input: < 0.0 ) )
   Then
   @{
           $log_msg << "Invalid values given to the parameters.~n"+
                       "The blend feature cannot be under 0.";
           ug_mqc_log( LOG_WARNING, {}, $log_msg );
     }
   Else
   @{
   	   $feats << mqc_askFeaturesByType( "BLEND" ); 

   	   $blend_obj << 
	   Loop { 
	       For $each_feat in $feats; 
	       For $blend_ra is mqc_askBlendRadius( $each_feat ); 
	       If( $blend_ra < first_input:) 
	           Append {$each_feat}; 
                };

     if ( Empty?($blend_obj) )
          then
          @{
              $detail_msg << mqc_sprintf("Found %s blend",
                               Format("%d", Length($blend_obj)));

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

Suresh
www.technisites.com.au

RE: Checkmate customization

(OP)
Thank you so much!!

RE: Checkmate customization

(OP)
The code now passes the test as long as there is one blend radius under the first_input, but I want to know what blend radiuses that do not pass the test (which ones that is over the first_input if there is any). How do you do this? I know you can use != to find everthing that is not equal to the first_input, but thats does not inclued the numbers that are under or the number I choose.

RE: Checkmate customization

(OP)
The answer that is found to anyothers who wants to know is:

CODE -->

If ( -Member( log_type:, { 1, 2, 3 } ) ) 
   Then 
       ug_mqc_empty_param_warning( )
   Else
   @{
       $usr_msg << If ( "" = log_msg: ) Then "" Else log_msg: + "~n" ;

       $part_unit << ug_askPartUnits( "" );
       $check_ble << 
           If ( ( ble_unit: = mm ) & ( $part_unit = pounds_and_inches ) )
           Then ble:/25.4
           Else If ( ( ble_unit: = inch ) & ( $part_unit = grams_and_millimeters ) )
           Then ble:*25.4
           Else ble:;
        
        $feats << mqc_askFeaturesByType( "BLEND" );

        $ble_feats <<
        Loop 
        {
            For $each_feat in $feats;
            For $feat_ble is mqc_askBlendRadius( $each_feat );
            If( ($feat_ble >= $check_ble) & ($feat_ble != $check_ble) )
                Append {$each_feat};
        };

        If ( Empty?($ble_feats) )
        Then
           ug_mqc_log( LOG_INFO, {}, $usr_msg + "This part has no edge blends with greater radius than specified." )
        Else
        @{
               $detail_msg << Loop
                        {
                              With $msg  Is  "";
                              For  $ble_feat  In  $ble_feats;
                              For  $ble Is mqc_askBlendRadius( $ble_feat );
                              For  $feat_name  Is  First( mqc_askFeatureNameAndType($ble_feat) );
                              For  $msg  Is  $msg+"~n"+$feat_name+"  ["+StringValue($ble)+"]";
                              Return Is $msg;
                        }; 
           
           $u_msg << mqc_sprintf("%s blend(s) with [radius] greater than specified:~n",
                                 StringValue( Length( $ble_feats ) ) );
           
           $usr_msg << (If ( "" = log_msg: ) Then "" Else log_msg:) + "~n" + $u_msg;

               ug_mqc_log( Nth(log_type:, log_type_option:), $ble_feats, $usr_msg + $detail_msg );
        };
   }; 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

White Paper – Choosing the Right Spring Loaded Connector
In today’s cost-sensitive world, designers are often driven to specify the lowest cost solution for every aspect of their designs to ensure that their solution is competitively priced and their company remains profitable. However, specifying a low-cost, low-quality connector solution can result in premature failure, considerable re-work costs and damage to reputations. Download Now
eBook – Own the Lifecycle: Sustainable Business Transformation
Increasingly, product and services companies are seeking more information and control in the operational lifecycle of their products, including service and use. Better information about the operational lifecycle, and the ability to use that information, requires more than just unstructured data flowing back from products in the field. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close