Skip to main content
21-Topaz II
May 12, 2016
Solved

Filter Repeat Region by Two Conditions

  • May 12, 2016
  • 6 replies
  • 19651 views

Creo 3, M070

I'd like to use two conditions to filter a repeat region, can I do this?

What I mean is that I want to filter all assemblies out of my region except the ones with the parameter BOM_DISPLAY set to YES.  So, I'd like to display assemblies only if these two conditions are met:

&asm.mbr.type  == ASSEMBLY*

&asm.mbr.bom_display  == yes

But, I believe that if I put those tow things in the repeat region filters the only items I'll get are those assemblies.  I'd like to get all the parts too (except skeletons and parts where BOM_DISPLAY is set to no).

So, what I want is:

&asm.mbr.type  != SKELETON*

&asm.mbr.bom_display  != no


&asm.mbr.type  != ASSEMBLY*

EXCEPT where:

&asm.mbr.type  == ASSEMBLY*

AND:

&asm.mbr.bom_display  == yes

Of course, that's not going to work.   How can I accomplish all of this?

Best answer by MartinHanak

Doug,

I created test data in CR2 M070 (repeat_region.zip). Unzip it, investigate it and apply it to your real data .

__rel_par.png

In Relations dialog box I had to create two highlighted parameters manually (as String parameters).

MH

6 replies

1-Visitor
May 12, 2016

Try:

&asm.mbr.type == ASSEMBLY, PART

&asm.mbr.bom_display == YES

21-Topaz II
May 12, 2016

A nuance that I failed to mention is that not all parts or assys have the BOM_DISPLAY parameter.  Right now, only the parts that I want to exclude do.

The more I think about this, I'm thinking that rules to exclude skeletons and the parts that I never what to show (parts of a purchased sub assy) plus then manually filtering the rest makes the most sense in this case.

23-Emerald IV
May 12, 2016

Doug Schaefer‌,

I would suggest using repeat region relations to set a parameter that can be used by the filter to determine whether or not to show each row.  Take a look at this discussion:  REPEAT REGION FILTERS

7-Bedrock
May 13, 2016

Maybe you need second BOM

24-Ruby III
May 13, 2016

Doug,

I created test data in CR2 M070 (repeat_region.zip). Unzip it, investigate it and apply it to your real data .

__rel_par.png

In Relations dialog box I had to create two highlighted parameters manually (as String parameters).

MH

21-Topaz II
May 13, 2016

I'm marking this as correct even though I've already gone with manual filtering for my application.  This does look like it would do exactly as I want, though.

7-Bedrock
May 13, 2016

like this?:

11.gif

7-Bedrock
May 14, 2016

Very good~!!!

If the component is not too much

Like this:

Asm create a parameter: bom_display=no

Filter:&asm.mbr.bom_display !=no

This is faster.

1-Visitor
March 4, 2019

Hi Doug,

 

I have a similar situation, but I need to use an OR condition in my filter. 

I want my BOM to include all assembly members (&rpt.level < 2) OR any sub-component with a custom parameter (&asm.mbr.BOM_DISPLAY == YES)

 

Do you know how I can accomplish this? Thank you!

 

Spencer

1-Visitor
March 4, 2019

Please disregard - I was way over-complicating it. I just discovered the Flat/Rec Item button in the repeat region menu. It does exactly what I need.