If node argument types

Why won’t the IF node accept a list of numbers? It says it expects argument types bool, var, var, but called with bool, int, var. I thought var could be anything?

Not sure why that would be the case. It works perfectly fine for me with the OOTB nodes.

Try this instead

I got it working if I use the same list for the true and false inputs. It must have something to do with keeping the input list structures the same.

image

Yes, if the list structure is not same, Dynamo will try to populate some weird looking result to match the list structure! [like it did for the if node on the right]

1 Like

This might help with a work-around that is more consistent:

1 Like

Thank you @jacob.small and @AmolShah.

I ended up getting the result that I needed by using the FilterByBoolMask node.

Every time I try to use the IF node for something, it doesn’t produce the results that I’m looking for. I suspect that the ScopeIf node would work better for me, but it usually crashes the application. Very frustrating.

1 Like