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

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

nur91m
Advocate Advocate
2,482 Views
3 Replies
Message 1 of 4

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

nur91m
Advocate
Advocate

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.

0 Likes
Accepted solutions (1)
2,483 Views
3 Replies
Replies (3)
Message 2 of 4

Joe.Ye
Alumni
Alumni
Accepted solution

 

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
Advocate
Advocate
Yes, it works. )) Thanks for your help Joe.Ye.
0 Likes
Message 4 of 4

seyedehmaedeh_aghili
Explorer
Explorer

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.

0 Likes