Is there any way of calculating a value from two existing parameters and reporting it to a Shared Parameter by using the Revit API?
My aim is to use this in a Tag to display a different flow value through a pipe.
I have seen a plugin doing it for Room Area and occupancy.
The image attached shows the parameters i'm using,
"Pressure Factor" & CW Flow are Shared Parameters.
The result im looking for:
"Flow/Pressure Factor=CW Flow"
Thanks
Solved! Go to Solution.
Solved by Joe.Ye. Go to Solution.
Hi,
This is possible to be done by Revit API.
You can read the two shared parameters value first, then calculate the value Flow/Pressure Factor, finally assign the value to CW flow parameter.
here is the code fragment
Pipe pipe = null;
//pipe is the target pipe. retrieve one target pipe and assign it to pipe variable.
Parameter flowParam = pipe.get_Parameter("Flow");
Double flowValue = flowParam.AsDouble();
Parameer pressureParam = pipe.get_Parameter("Pressure Factor");
Double pressureValue = pressureParam.AsDouble();
double cw = flowValue/PressureValue;
pipe.get_Parameter("CW Flow").Set(cw);
Hope this helps.