Revit rebar dynamo - U-shaped rebars in a curved wall - example 22
Download the full Revit Rebar tutorial PDF here
The last wall, a curved wall with varying height, Dynamo will be applied to generate the U-shaped rebars both top and bot. For the bot rebars, Dynamo player will be used. Making your script Dynamo player ready makes it easy for yourself and your colleagues when running the script again later.
Free form rebar is explained here.
Select edge is the rebar path, the rest of the input values are pretty straight forward and need no further explanation.
A little side note, the rebar length, and width will appear as 600mm and 180mm when generating the U-shaped rebars.
2. Spacing along the curve, trim line for rebar cover
Curve.TrimByParameter is used to shorten the curve at both sides, the distance that shortens represent the rebar cover.
To divide the newly created curve into equal segments length equivalent to spacing specified in input_1, we use Curve.PointsAtSegmentLengthFromPoint . The number of segment length is counted with List.Count.
The number of points found with List.Count is a parameter in the code block, the code block is set up as follow: 0..1..#a. You can interpret the first part(0..1) as a percent of the curve. The 0, means you start at 0% at the curve, and the 1, you end at 100% of the length. If the number were 0,1..0,9, we would have started at 10%into the curve and ended at 90%, in total 80% of the midsection of the curve will have distributed the #a numbers.
in our case, 100% of the curve will be used to place out x-number of points along the curve. The number of points is determined by the input value #a, previously found with list.Count.
So, the code block is used as a parameter in the node Curve.PointAtParameter. We now have the spacing between the rebars, symbolized as points on the curve.
3. Vector, 90 degrees on the curve
The next section has been done a couple of times in earlier examples.
What we want is to create individual vectors that are perpendicular to the curve for every point we sat along the curve in the previous section, this allows us to place the U-shaped rebars at the correct angle, with the correct dimensions.
The first step is to make a plane perpendicular to the line for each of the points, using Curve.PlaneAtParamter. further, turn this into a vector with Plane.Normal, Then extracting the vector from Plane.Normal, we only need direction in the XY-plane, then rotate the vector 90 degrees.
In the last step, we retrieve vector.X and vector.Y from the previous Vector.Rotate, and uses Vector.ByCoordinates to merge the vectors again, leaving the Z vector blank, The reason for this is because we want this value to be 0(only rotation in XY-plane). We now have individual vectors in XY direction for each of the points along the curve.
The tools(points along the curve with correct spacing and a perpendicular vector for every point) needed are now created and available for the next phase.
The next phase consists of creating the 4 points, using the tools, that will eventually form our U-shaped rebar.
Every point is created with the node Geometry translate, and collected in a list with List.Create.
To create the U-shape we desire, the node Line.ByStartPointEndpoint is used to create lines between the points that were made in the previous section.
Further, the lines are assembled using a code block, it is important that the order of the lines is correct so that the lines that are made form a U-shape as shown in picture 6. List.Transpose reorganizes the list so the list can be read by the node PolyCurve.ByJoinedCurves, to form one curve out of the three lines.
The U-shaped rebars have now been produced in dynamo, the last step, getting them into Revit as rebars.
Arrive at the second input box, this box is related to the rebars value.
Rebar style is standard, the diameter of the rebar is 10 in this example, none RebarHookType, select the model the rebars are going to be placed in, RebarHookOrietation is left.
The vector input value is probably best communicated by Dieter Vermeulen at Autodesk
The vector is the direction in which the rebar would get distributed, and represent the normal vector of the plane in which the rebar sketch is created. This can be easily found with the curve.normal node.
the four last nodes determine the parameter values for the shape(21) and partition-POS.Nr(51).
7. Import rebar to Revit
The main node in this section is CreateFrom.Curves, and can be found in the package dynamo for rebar. All the input values are described in the 6.Input.
The parameters mentioned are (shape and partition) set by the node Element.SetParameterByName and linked with the main node, this means that all the rebars created from the main node will have the parameters decided in 6.Input.
We also want the rebars created to be solid in view, this is done by using the node Create.SetSolidInView.
Click here for Revit Rebar tutorial part 5