List.Contains with two lists of different lengths

I have two lists of different lengths. Both contain key values from the same list (curve list).

The list that contains 11 items is the result of seeing if a box intersects with a curve from the curve list.

The other list with 6 items is the keys from the curve list.

Now I want to compare the 6 item list to the 11 item list. If the value is not on the 11 item list I want to return false if it is I want to return true. (I have my desired output shown in picture.)

I’m thinking that I can use the ‘List.Contains’ node to go through each list, but I’m thinking that I’m not getting the lacing right.

I appreciate any help or direction.

I was able to figure out how to get 11 lists of 6 items so true or false for each of the 11 items.

But I really just want one 6 item list.

So a way to combine these or a better method to compare the two lists.

Again I appreciate any help or direction.

Try a combination of the == node set to cross product and the contains node.

Or if your going the other way just change the levels on your list.contains.

2 Likes

Or instead of Booleans.anytrue use List.AnyTrue from clockwork.

This node actually works correctly on its own. List Levels is making it worse. The inputs are to see if a list contains an item. It’s already expecting a list and a singleton so if you supply a list and a list it will iterate through the item list automatically.
image

1 Like

This works.

Thank you. I did not have this package installed.

Oddly though I had to switch the inputs around. I tried it the way you show with shortest lacing and I end up with a list of lists. If I flip the inputs and keep lacing at Auto I end up with the results you show.