In my main script, which creates longitudinal beam rebars from a straight curve, the resulting shape is L-shaped (a hook type Standard - 90 deg. is added to one end of the bar to form the L-shape). I need to ensure that the Bar Length parameter in the Rebar Properties does not exceed 12.00 m.
Based on the formula I retrieved from the Rebar Shape Parameters related to Shape 11, which defines the bar length calculation , I used Excel to verify the bar length for the two rebar shapes shown in the image below:
The top rebar was created directly by selecting Shape 11 from the Rebar Shape Browser.
The bottom rebar was first created by selecting Shape 00 from the Rebar Shape Browser, then a hook was added to one end, after which Revit automatically generated a new shape named Forme d’armature1.
However, the bar length I calculated in Excel is slightly different from the one displayed in the Rebar Properties. I’m a bit confused about how Revit calculates this parameter.
I did see your question on the Revit structures forum as well, have you tried using the Rebar families that come with Revit 2025 or 26? The length calculation is done within the family, the Structural Rebar family you are using may have been corrected or it could apply to a certain country?
Of course. As you can see in the image below, I made sure to enter the same parameters in my code to reproduce the same results. However, the Bar Length displayed in Revit is completely different from my output, so I’m a bit confused and I don’t know how Revit internally computes this parameter ?
Revit calculates the centreline length of the bar and the standard hook bend radius is used.
here’s an exact formula to calculate the length : R is std hook bend radius.
The formula you provided (which is exactly what I was looking for) gives the same value for the Bar Length displayed by Revit in my example for the generated shape Forme d’armature 1.
I understand now that Revit calculates this value by retrieving the centreline length of the bar.
My question is: can you provide me with a link to the Revit documentation that explains how the centreline length of a rebar is calculated, and how I can retrieve it programmatically using Dynamo?
Your code return the expected value for Bar Length as it’s displayed in the rebar properties shown in the image below.
However I still have another question as I explained in the image, so please response me
As Mike mentioned, “Length of each bar” looks like a calculated parameter (not revit default, someone could have added it)
The formula seems to be standard : A + B + C - r -2d = 9983.7 + 800 + 600 - 75 - 20 = 11288.7mm
”Bar Length” and “Total Bar Length” are revit parameters.
You misunderstood me… I’m not talking about the calculation of “Length of each bar”, which depends on each shape and may change when the shape changes.
As @rajeshjamariya16 mentioned, even though “Bar Length” is a Revit parameter (and I assume it is the basis for calculating “Total Bar Length” by multiplying it by the number of bars), Revit uses the rounded value of “Length of each bar” (which is 11 290 mm) instead of the actual rounded value of “Bar Length” (which is 11 295 mm).
So my question is: Which rule or parameter does Revit use to decide the final value of “Bar Length” that is then used to compute “Total Bar Length”?
It’s now clear to me how Revit adjusts the Bar Length and Length of each bar based on the reinforcement rounding settings.
As you can see in the image below, and based on the guidance from @rajeshjamariya16 and @Mike.Buttery, I was finally able to solve my issue and create an L-shape rebar with the desired Bar Length (equal to 12.0 m) by applying the following code