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 donāt know how Revit calculates the length exactly but the below command may be useful, I think it could be run once your script has added the bars.
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