Need help creating stirrups (rebar) in beams using Dynamo — wrong dimensions & wrong placement

Hi everyone,

I’m trying to build a Dynamo script that automatically generates stirrups inside a beam, but I’m running into issues with the geometry and placement of the rebar. I’ve spent several days trying to troubleshoot (even with ChatGPT) but I still can’t get it right, so I’m hoping someone here can point me in the right direction.

What the script does so far

  1. The script starts by asking the user for several inputs:

    • The beam element to place stirrups in

    • The rebar diameter

    • The stirrup shape (rectangular for now)

    • The spacing (eventually I want to support 3 sets of stirrups per beam — two end zones + one middle zone — but I am currently testing with just one set)

  2. With Python, I extract:

    • The perimeter curves of the beam’s cross-section

    • The surface and geometric data for reference

  3. I compute a centerline for the stirrup by offsetting the perimeter curves inward.
    The offset considers:

    • The beam’s cover

    • Half of the bar diameter

  4. I feed the resulting curves into Rebar.CreateFromCurves (via the Create.FromCurve node in Dynamo) to generate the stirrup.

The problem

Even though the offset geometry looks correct (conceptually), the resulting rebar:

  • Has incorrect dimensions

  • Is sometimes larger than the beam itself

  • And worst of all, is being created outside the beam, instead of inside the section

I’ve double-checked:

  • Coordinate systems

  • Units (I fixed an earlier mm vs cm issue)

  • Offsets

  • The curve order

  • The shape matching Revit’s default stirrup families

But the problem persists.

What I’m trying to understand

  • Why do the stirrups get created with the wrong dimensions even though the input curves should match the adjusted section perimeter?

  • Why does Revit place the rebar outside the beam, even when the curves are clearly inside the cross-section when inspected in Dynamo?

  • Is there something special about the coordinate system or curve direction that I’m missing when working with Rebar.CreateFromCurves?

If anyone has run into this before or can spot what I might be doing wrong, I would really appreciate the help.
This is part of a larger workflow I’m developing, and I feel stuck at this point.

Dynamo File

Thanks in advance!

1 Like

Here’s a version working back from the create node. Be careful to check the directions of the normals as this will set the direction of the offsets and the rebar multiples. Try using Create.FromCurves with individual lines in a loop - see graph below