# List Help- If statement and flipping List data

I’m really struggling with Lists. At it’s simplest form, i have a rectangle with Width and Height reporting as independent doubles. In some cases, I would like to flip the Width and Height, based on a True/False list. It is my understanding that I need to combine Width and Height into one list in order to flip the data, which I, crudely, have managed to do. I have also created a True/False list. This is as far as I was able to get. My end result would hopefully be : 2 lists, where if “X” statement is true, than in the corresponding level in my list would flip 0 and 1 numbers.

My apologies for poor explanation, and will clarify if needed. Thanks for your time!!
@Dimitar_Venkov Springs Package got me this far, thank you!
Jonathan
Annotation 2019-11-11 133601.pdf (605.1 KB) Room Tag LxW 2-0.dyn (51.9 KB)

1 Like

Hope this is what you were looking for.

1 Like

The issue gets a little more complicated when the booleans are nested lists like in his example above. There are two solutions to this, either flatten the boolean list so that they match the structure in @AmolShah’s post or cycle the booleans so that its a nested list with two booleans per list.

Like below:

2 Likes

In that case, this should work!

2 Likes

Thank you both @AmolShah and @kennyb6 !!

I tried both solutions, just to better my understanding of what is going on, and they both produce the correct result. Thank you so much!

Every time I tried running my numbers list past the true/false list, I think it was multiplying the lists, i.e. rather than a list of 35, I ended with a list of 1225. I was missing the syntax you both provided to compare the 2 lists at the corresponding levels.

Thank you again!
Jonathan