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: 

How to set and retrieve a size of created ducts with API?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
nur91m
2090 Views, 3 Replies

How to set and retrieve a size of created ducts with API?

Hi everyone!

 

How to set and retrieve a size(diameter of round ducts, height and width of rect ducts) of created ducts with API?

 

I'm using VS C#2010.

3 REPLIES 3
Message 2 of 4
Joe.Ye
in reply to: nur91m

 

Hello,

 

You can get the duct's shape from the duct's parameter.

For the round duct, you can get and set the duct diameter via this parameter: RBS_CURVE_DIAMETER_PARAM

 

for the rectangle duct, get and set the height and width via these two parameters:  

Width: RBS_CURVE_WIDTH_PARAM

Height: RBS_CURVE_HEIGHT_PARAM

 

For example, you want to increase a round diameter by 10mm. Here is the code fragment.

 

<code>

Parameter param = duct.get_Parameter(BuiltInParameter.RBS_CURVE_DIAMETER_PARAM);

double diameter = param.AsDouble();

param.Set(diameter+10);

<code>

 

Hope this helps!

 

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
Message 3 of 4
nur91m
in reply to: Joe.Ye

Yes, it works. )) Thanks for your help Joe.Ye.
Message 4 of 4

Hello,

 

Is it possible to increase the input parameter of duct cross section? since in my case it's not recatngular or oval, it needs more parameter to be defined.

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