FilterByBoolMask output keep list structure and sorting

Hi,

Anyone that cant give me some advice how to keep list structure and sorting, see image below.

Thanks!

@BIM_Mrbrango .

instead of using filters you can also use groupByKey and than indexing your Items…

That would be my first idea…

KR

Andreas

OK, do you think I shall change filterbool in the begining (Red circle) or at the end ?
I dont see how this should help me get the list structur that I want, but will give it a try.

Thanks @Draxl_Andreas

By the way, du you also have a solution to this list logic.
Everthing filters right until the end, why?

Can you explain what you’re actually trying to do here? Your first image is illegible and it’s a little confusing. List structure and sorting won’t change unless you do something to change it.

Hi @Nick_Boyts,

Sorry that the picture is not fully legible, I initially thought that it did not need to be shown as the question was only about how I should be able to preserve the structure.

Just as you write, the structure of the list has been changed, now I want to try to recover the structure of the rest of the nodes in the port out.

As you can see from the Image from first post (I filter out everything except 2 points that I process for creating Tee. The out port I deal with vertical pipes that dont have horizontal pipes, these other gaps might have had a valve of some sort that need to be handled)

Picture below does not work properly, because of the other issue that I ran into when adding one more pipe branch as mentiond below.

Now I want to see if it is possible to recover the other nodes in the OUT and keep the same structure without having to do the same processing again, which feels unnecessary if there is a better way to divide what should go to port IN and port OUT.


Picture number 2 wich I updated in this post.

Before I flatten the list, the information comes from MepOver’s Element.Connectors.

I use List.GroupByFunction to group all y-axes, which appears in the image, all values ​​are grouped correctly.

But if you look at the final product, I have 10 nodes out, but they are not the nodes that were grouped in List.GroupByFunction.

What I do know is that I created another pipe branch in the picture below labeled 2, when I only had pipe branch labeled 1 there were no problems with the end result.

Hi probably i dont understand, but is you goal connect these pipes with elbow and tee fitting ??

Im confused in which way you want to restructure the end result?

If the number of items in both the unfiltered and filtered lists is the same, then you can use this method…

If it is not, then without a better explanation (by that i mean, dumb it down a bit, simplify what you are asking) then i am so confused.

1 Like

Hi @sovitek
I didn’t know I was so unclear with explanatory text and pictures.

But I want to see if there is a solution to keep the same structure from one list to another.

When it comes to tee’s, I have it figured out.

I want to keep the list structure for the group Vertical pipes that dont have horizontal pipes.

This is to avoid building the same structure again, but then minus the nodes that have moved on via the IN port

So what you are trying to do is…your original list, minus the items on the second list?

YES, thats correct

Correct me if I’m wrong. Can’t you just… hit “use levels” and “keep list structure” on boolMask “list” input?
Can’t test rn but could have sworn I have used it before for advanced filtering.

EDIT:
Tested - you absolutely can:

1 Like

Great, I’ll try it later and mark this as answer

As I mentioned earlier, structure and sorting only change if you do something to change them, which you did. When you group the connector locations based on the Y coordinate you’ve restructured your data. The list of grouped points no longer matches the list of connectors.

You’re probably better off restructuring the connectors to match your data. You can use GroupByKey instead of GroupByFunction to group the connectors based on their Y coordinates (keys). Then you’ll be dealing with the connectors directly.

1 Like

Hi Nick,

Thanks, I’ll give it a try later when I’m on the computer again

Super Thanks @1bitBoolean !

This is the end result, exacly what I wanted!!
Now I can continue with OUT nodes in the same exacly like they came in.

1 Like

Hi again @Nick_Boyts,

I change to GroupByKey but the same result remains, even closed down dynamo and revit between dynamo runs to see result, its the same.

If I remove the upper pipebranch everything work great. But when I add it again the “error occur”.


You want to group the connectors not the points. Then you’ll be dealing with the connectors themselves and won’t have to worry about matching the original list structure. You still use the connector location and Y coordinate as the key to group by, but you feed the list of connectors.

1 Like

Hi @Nick_Boyts,

You are of course right, why didn’t I see this….

I knew it all along but wanted to check if you saw the error :wink:

I even added a 3 pipe branch and it works great.
Again, many thanks!!!


2 Likes