Replace by condition works unexpectedly with diffrent inputs

Hi all, I’m trying to recreate a list of booleans to list of ones and zeros 0-1 but I don’t understand why ReplaceByCondition node works differently with different inputs. When I’m replacing True with 0 its replacing the whole list into 0, but when I’m replacing true with 1, its changing only true indexes. Its a bug or I just don’t understand the node? You can find the problematic image in a post below, new users can only upload one photo.
Thank you for your time in advance. Maciej.

Your graph and your output look like perfectly fine to me. Could you show us a screenshot of the error, or write what are the outputs you expect ?

1 Like

New users can only update one photo, here is problematic one:

I see. In DesignScript, and other programming languages, 1 and true are usually considered to be the same value, same with 0 and false.

2018-08-20%2010_53_07-Dynamo

Dynamo sees your 1 and true list as a list filled with true only. That is why it is working in the first screen but not the second one.

One way of inverting the values is to proceed as you did in the first screen, and then to subtract your list from 1.

2018-08-20%2010_53_07-Dynamo

1 Like

That was one of my thoughts but it was not perfectly obvious. Thank you for the help! Maciej