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: 

Get Property Value of Rebar: Bar Diameter REVIT API

1 REPLY 1
Reply
Message 1 of 2
carlosfposadas
1192 Views, 1 Reply

Get Property Value of Rebar: Bar Diameter REVIT API

Hello:

 

Anyone knows how I can get the property value of a rebar "Bar Diameter" and then convert to a string value?.

 

Tanks!

1 REPLY 1
Message 2 of 2
Aaron.Lu
in reply to: carlosfposadas

Dear,

Looks like Rebar's diameter is defined in its type, so use Rebar.GetTypeId()
to get the id of its type, and Document.GetElement(id) as RebarBarType to get the bar type object,

then use RebarBarType.BarDiameter to get its value.
or use the parameter:

var parameter = RebarBarType.get_Parameter(BuiltInParamter.REBAR_BAR_DIAMETER);

and then parameter.AsDouble() to get the double value.

or use parameter.AsValueString() to get the display string with unit.

Is that helpful?
thanks.


Aaron Lu
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