The Autodesk.Revit.DB.Structure.RebarBarType
class represents a type of rebar bar in a Revit project. A rebar bar type defines the properties of the rebar bars that are used in structural elements such as beams, columns, and walls.
Name
: Gets the name of the rebar bar type. This property is read-only.
Diameter
: Gets the diameter of the rebar bar type. This property is read-only.
Material
: Gets the material of the rebar bar type. This property is read-only.
BendDiameter
: Gets the diameter of the bending loop for the rebar bar type. This property is read-only.
BendAngle
: Gets the angle of the bending loop for the rebar bar type. This property is read-only.
ScheduleName
: Gets the name of the rebar bar type's schedule. This property is read-only.
GetBarGeometry()
: Gets the geometry of the rebar bar type. The geometry includes the shape of the bar and the dimensions of the bending loop.
GetSpacing()
: Gets the spacing of the rebar bar type. The spacing is the distance between the centers of adjacent bars.
GetWeightPerUnitLength()
: Gets the weight per unit length of the rebar bar type. The weight per unit length is the weight of one unit (e.g. one meter) of the bar.
Rebar bar types can be created and modified using the Autodesk.Revit.DB.Structure.RebarBarTypeBuilder
class.
Rebar bar types are stored in the Revit project as a part of the project's settings.
Rebar bar types can be used to create reinforcement elements such as straight bars, stirrups, and ties.
// Get all rebar bar types in the project
FilteredElementCollector collector = new FilteredElementCollector(document);
ICollection<Element> rebarBarTypes = collector.OfClass(typeof(RebarBarType)).ToElements();
// Iterate through the rebar bar types
foreach (Element element in rebarBarTypes)
{
RebarBarType rebarBarType = element as RebarBarType;
// Get the name of the rebar bar type
string name = rebarBarType.Name;
// Get the diameter of the rebar bar type
double diameter = rebarBarType.Diameter;
// Get the material of the rebar bar type
Material material = rebarBarType.Material;
// Get the schedule name of the rebar bar type
string scheduleName = rebarBarType.ScheduleName;
// Get the geometry of the rebar bar type
RebarBarGeometry geometry = rebarBarType.GetBarGeometry();
// Get the spacing of the rebar bar type
double spacing = rebarBarType.GetSpacing();
// Get the weight per unit length of the rebar bar type
double weightPerUnitLength = rebarBarType.GetWeightPerUnitLength();
}