Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkmate - suppressed components

Status
Not open for further replies.

lklo

Industrial
Nov 24, 2010
226
Hi -

Do anybody here on board , know if it should be possible to check for suppressed components in a NX assembly.
I'm running NX 8.5...

lklo
 
Replies continue below

Recommended for you

Hi,

Try this basic checker:-

Cheers, NXJ

#! NX/KF 3.0
#

DefClass: check_for_suppressed_comps ( %ug_base_checker );
( String ) %test_category: "MyCustomChecks.Modelling";
( String ) %displayed_name: "Check For Suppressed Comps";
( Boolean Parameter ) Disabled?: False;
( Boolean Parameter ) save_log_in_part: False;

# Attributes for this class
( List Modifiable ) assy: ug_askAssemblyComponents( );
( List Modifiable ) violations: Loop {
For $a In assy:;
For $b Is mqc_isComponentSuppressed( $a, "lib", "libufmqc", "Name", "mqc_ufkf_is_comp_suppressed" );
If ( $b = 1 ) Collect $a;
}; ;

# Checker function
(Any Uncached) do_check:
If ( (-Empty?(violations:)) )
Then (mqc_log( LOG_ERROR, violations:, "Assembly contains suppressed components"))
Else (donothing);
 
Hi -

Thank you so much for sharing this checker....
-I will use your checker sample as a starting point for me...

In my case I only need to check for components in current workpart - what I mean is only 1.level of assembly..
I have done this in a checker where I call a external NXOpen program (compiled VB) and return a list into the dfa checker.
But runtime is slow by doing it this way - and I will try to do all the stuff inside a dfa checker, without "leaving" dfa and go to a external program...

lklo
 
Hi

On assembly navigator right click on the top bar
And check the box of "include suppressed component "

Maybe that's not your intentions but it shows
The suppressed component in blue.
 
hi -

thx - and yes your are right...
But I will run checkmate on thousands of parts in one shot, and need checkmate to help with this...

lklo
 
Ok,

This version will only check the immediate children of the parent assembly.

Hope this helps,

Cheers,

NXj

#! NX/KF 3.0
#

DefClass: check_for_suppressed_comps ( %ug_base_checker );
( String ) %test_category: "MyCustomChecks.Modelling";
( String ) %displayed_name: "Check For Suppressed Comps";
( Boolean Parameter ) Disabled?: False;
( Boolean Parameter ) save_log_in_part: False;

# Attributes for this class
( List Modifiable ) assy: mqc_askImmediateComponent( "lib", "libufmqc", "Name", "mqc_ufkf_ask_immediate_component" );
( List Modifiable ) violations: Loop {
For $a In assy:;
For $b Is mqc_isComponentSuppressed( $a, "lib", "libufmqc", "Name", "mqc_ufkf_is_comp_suppressed" );
If ( $b = 1 ) Collect $a;
}; ;

# Checker function
(Any Uncached) do_check:
If ( (-Empty?(violations:)) )
Then (mqc_log( LOG_ERROR, violations:, "Assembly contains suppressed components"))
Else (donothing);
 
hi again -
I was not aware about this predefined function > mqc_askImmediateComponent..
But excellent checker you shared....
thx so much...

lklo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor