Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MEP Calculated Values in Shared Parameter

1 REPLY 1
SOLVED
Reply
Message 1 of 2
heinwelman
1197 Views, 1 Reply

MEP Calculated Values in Shared Parameter

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

1 REPLY 1
Message 2 of 2
Joe.Ye
in reply to: heinwelman

 

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.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community