Using Revit's built-in rebar feature as an example (for non-Revit rebar features, please visit my Youku channel)
Step-by-step process:
1) Import the steel bars into Revit before starting development.
2) If the existing steel bar family shapes do not meet project requirements, create custom steel bar families.
3) Familiarize yourself with the capabilities of Revit’s rebar API (a translated overview).
Here is an example demonstrating the creation of spiral hoop reinforcement:
/// <summary>
/// Creates a spiral hoop reinforcement
/// </summary>
/// <param name=”revitDoc”>The Revit document</param>
/// <param name=”barType”>The type of rebar</param>
/// <param name=”host”>The host element</param>
/// <param name=”locationPoint”>The insertion point</param>
/// <param name=”luoju”>Pitch of the spiral</param>
/// <param name=”lx_height”>Height of the spiral</param>
/// <param name=”lx_r”>Radius of the spiral</param>
public void CreatLXRebar(Document revitDoc,RebarBarType barType,Element host,XYZ locationPoint,double luoju,double lx_height,double lx_r)
{
RebarShape rebarShape = null;
foreach (var item in TempRebarType<Element>.ListRebarShape)
{
if(item.Name == “53”)
{
rebarShape = item as RebarShape;
}
}
Rebar rebar = Rebar.CreateFromRebarShape(revitDoc, rebarShape, barType, host, locationPoint, new XYZ(lx_r * 2, 0, 0), new XYZ(0, lx_r * 2, 0));
rebar.ScaleToBoxFor3D(locationPoint, new XYZ(lx_r * 2, 0, 0), new XYZ(0, lx_r * 2, 0), lx_height);
IList<Parameter> listParameters = rebar.GetParameters(“螺距”);
listParameters[0].Set(luoju);
IList<Parameter> listParameters2 = rebar.GetParameters(“Top layer turns”);
listParameters2[0].Set(0);
IList<Parameter> listParameters3 = rebar.GetParameters(“bottom layer turns”);
listParameters3[0].Set(0);
IList<Parameter> listParameters4 = rebar.GetParameters(“高度”);
listParameters4[0].Set(lx_height);
IList<Parameter> listParameters5 = rebar.GetParameters(“R”);
listParameters5[0].Set(lx_r);
}
Note: The number “53” corresponds to rebar type 53.
By combining this reinforcement method with techniques shared on my channel, you can generate a reinforced pile with just one click.













Must log in before commenting!
Sign Up