If Statement/ Updating the Revit Parameter

I used this to make a quick version of your dataset:

Capture

From there I ran this script:

Which is basically just this code:
//first define the variables
rooms;

RH =
	rooms.GetParameterValueByName(
		"Humidity"
	);

Temp =
	rooms.GetParameterValueByName(
		"Temperature"
	);
RH30Min = 24.8;
RH30Max = 28;
RH60Min = 23;
RH60Max = 25.5;

//then do some logic work

CalculatedWorkingRange =
	//if the RH is 30
	RH == 30?
		//is the temp less than the min?
		Temp < RH30Min?
			"Too Cold!":
			//if not is the temp over the max?
			Temp > RH30Max?
				"Too Hot!":
				//if not the temp is good
				"Just Right!":
	//if the RH is 60...
	RH == 60?
		//is the temp less than the max?
		Temp<RH60Min?
			"Also Too Cold!":
			//if not is the temp over the max?
			Temp>RH60Max?
				"Also Too Hot!":
				//if so than the temp is good
				"Also Just Right!":
	// but if the RH was neither 60 nor 30...
	"Your condensation is showing";

//and set my parameter value with my result
rooms.SetParameterByName(
	"Working Range Check",
	CalculatedWorkingRange
);

And got this result:

Capture

3 Likes