Filtering out Empty Lists

Hi all,
I am facing a problem with filtering my list.

As shown, Element.GetMaterials results in empty lists for some elements e.g.: for wall foundation 738479.

I want to remove this element with empty list from list #1. I tried using List.Clean then filtering the #1 list by bool mask but failed, probably because i’m feeding it a list of materials rather than a list of booleans.

Any ideas how to make this work ?

Mask should be True or False value.

You don’t need List.FilterByBoolMask
Seems like you’ve already eliminated Empty Lists (your intended result) at step 3 with List.Clean

1 Like

That’s another way to do it, Thanks.
What package contains this custom node GetMaterialLayers ?

Custom Node: Chynamo v.0.8.5

1 Like

I’m sorry if my explanation was not clear enough. After eliminating the empty list, I want to get only the elements corresponding to Materials in list #3 only, so that element at index 1 in list #1 is removed.

Replace List.Clean with List.IsEmpty to get a list of booleans

2 Likes

That’s it it works now. Thanks !

1 Like