Two out of 3 if false

I thought maybe my design script was off…
but the tests is returning false… so why is it returning a list of 2 references instead of 3? I replaced the true with a number just for debugging and it does go to the list of 3 plugged into false. very confused


@john_pierson
simple search
helped me find
@GavinCrump
if,
which says it’s different than out of the box because it’ll take different size** list**

“On the Shoulders of Giants”!

2 Likes

I seem to recall they were going to fix that in later versions, but looks like it’s still playing up in Revit 2023. I’ve always assumed there must be some weird lacing going on behind the scenes there that causes it. Glad to hear my logic node helped, it’s just a bit of Python really.

For the reference of others… as these If threads get dug up often.

flow

# Made by Gavin Crump
# Free for use
# BIM Guru, www.bimguru.com.au

#Code
if IN[0]:
	OUT = IN[1]
else:
	OUT = IN[2]
1 Like

yes, very useful. I can’t imagine how long that would have taken me to even guess what was wrong, much less a solution. I’m one month away from my first review at this new position and this will make me look like a much better investment than scratching my head for the next few weeks.

1 Like

The old IF node was not immediately removed so that legacy graphs would continue working, but the new IF node was added and does fix the list length issue. You may just be looking at an old instance of the node.

2 Likes