Filter values list with other values from another list

Dears,

I’m trying to filter a list with the values from another list, getting at the end a boolean list.

In other words, coming from the list generated by “Element.GetParameterValueByName”, I would like to crosscheck all values with the “CodeBlock” list what I’ve made. Getting at the the, a boolean list with “true” or “false” keys. In order to use it on a FilterByBoolMask node, and to get a filetered list with the previous elements. Captura

Thanks in advance

What about a List.Contains node?

ListContains

2 Likes

Doesn’t work properly.

I sure headache comes cause both lists don’t follow ther same values order.

Thanks,

But, if the input list comes from a “messy” values list, the code block launchs all falses. For Example:

imagen

The item “42” on the list has the no. 9 which is equal than item “2” of Codeblock, no. 9 as well. Then, on the boolean list (the last one), the result sould be “True” instead of “False” that I get.

My fault.

For now, solved.

imagen

I’m gonna try on the original dynamo.

As I understand, you want to split the elements of list A, according to List B:

  • if elements A are in list B > True
  • if elements A are not in list B > False

Am I correct?

If yes, just do it exactly as I posted it, remember to use LONGEST LACING (look at the right-bottom corner, you have now AUTO).

In the screenshot you posted, I expect the following result:

True,False,True,False,False,True,False,True

which is not exactly what you have

1 Like

I think that you should look again at @lucamanzoni’s solution.

Yours only gives a true to 0 it should also do so for 5 & 6?
image

I think you need to copy his longest lacing and levels… As @erfajo suggested.

@lucamanzoni’simage

@FernandoFCC’s image

Hope that helps…

Mark

2 Likes

Thank both very much, I was solved using longer lacing.

1 Like

For me it doesn’t work