What if you have more than 1 if statement?

Hey everyone, ive been looking through the forum for examples on multiple if statements. But, all i could find are one if statement examples. Does anyone know how to do this with nodes or design script?

1 Like

Try this code block:

	"Family 1 Goes Here":
		"Family 2 Goes Here":
		"Family 3 Goes Here";

You can go as deep as you like, and remove the quotes to use different families which will become inputs to the node instead of strings.


Hey Jacob,

Do i just put in the family name where it says “Family 1 Goes Here”? When i remove the quotations i get an error.

Post what you did so I can walk you through it. All versions of Dynamo for Revit was uninstalled by IT in my computer last night so unfortunately I can’t do it directly for you.

HOLY MOLY! if this is what you meant, it worked!!! thank you thank you jacob


That was it. For speed sake remove the a; b; c; … g; part. The input variable can be called after the fact in this case and it will make things read better and can help with performance on larger graphs too.


thank you once again!

Hi Jacob.

I have a scenario where a STRING response is required to be returned, depending on whether a value occurs between ranges of values. But l have tried it with IF statements, <=, >= etc, but no joy.

Any thoughts on what l am doing wrong?


1 Like

My value is 8.085, therefore l am expecting response ‘b’, but l get “”

Are you certain all your values are “flattened”?

You don’t have a valid conditional statement. You need to use && for a range of values.


Just ask them in sequence - if it’s less than 5.4 then return the first value. If the value wasn’t less than 5.4 but it’s less than 8.5 then your number falls between 5.4 and 8.5. No need to check if it’s > 5.4 a second time.

That said, the logical statement you couldn’t find is:

T> 5.4 && T< 8.4

Though the upper value should likely be a <= test.

You’re still doing 2x the amount of computations here - Only ask something once unless you have a requirement to do it twice. By asking smallest to largest you’ll remove parts from the set sequentially.


I am doing something wrong here but I cannot figure it out. Any of you have an Idea?

Edit: List.Firstitem output was a string not a number. Simple String.ToNumber and it works fine now.
Some times you get drawn into what you are doing and you forget to look at what you have done.

What is the Object.Type for “Days”?

By the looks of it, I’d wager it’s not an integer.

1 Like

Ya sorry it was a string. I was zoomed in to much and forgot what the data was.