Use OR node with list of boolean

I try to have an OR operation with two list of boolean in input to have on list of boolean in output.

The result is nul instead expected to be True if one of the index of list is True

What version of Dynamo are you in? Can you confirm those are boolean values? For some reason they aren’t color coded as booleans, so I’m confused as to what’s going on. What if you use the OR operator (||) instead?

Edit: I also just noticed that the values you’re checking don’t seem to be recognized as strings either, but they do seem to function properly in the node. Weird.

1 Like

2.13 version open directly from Robot Structural Analysis
I manage to filter list with this boolean list thanks to List.FilterByBoolMask node.
Nevermind it’s working with the operator instead
Thanks !!!

Weird. Something seems off. What you have should work. Glad you got it figured out though.

Yes weird, data are extracted from CSV file with Data.ImportCSV node. Some row are number that need to be converted with String.ToNumber node prior to be rounded for example

I could be wrong but I think the Or will only work with one bool item for each input and not a list.

image

you could python

import clr

list1 = IN[0]
list2 = IN[1]
result=[]
for l,i in zip(list1,list2):
	if l == True or i == True:
		result.append("true")
	else:
		result.append("false")

OUT = result

what is the object type ?

System.Boolean

Hey @sovitek , what package is that Or from?

This one doesn’t provide lacing
image

2 Likes

Understood, that’s why it was not working !

Lacing was added a bit later to many of the logical operators. It won’t be available in earlier versions.

Good catch though. That will cause it to fail on lists. The || node is usually what you want when comparing two options anyway. Otherwise you can always use AnyTrue.

2 Likes

yeah a version thing :wink: im in 2024

1 Like