Revit dynamo - model rebars, L-shape - example 12
0. Intro
In this example, we will generate L-shaped rebars (code 11) in a foundation slab.
The rebars will be in the center in the slab, see picture 8 for the finished result.
1. Input-1
Select the face at the concrete slab that will host the new L-shaped, then count the number of holes in the concrete slab, the rest of the input values are pretty straight forward and need no further explanation.
2. Creates lines along the sides
Surface.PerimeterCurves is used to select all lines on the surface selected in 1, reorganize the list with List.Flatten.
total of 7 lines, including the curves for the holes(3 holes), we need to remove those, do that with the node List.TakeItems, is then left with the 4 outer curves of the selected surface.
The rebar cover complies with the nodes /WClosedCurve.Offset+ and Geometry.Translate, and are then patched up again to a surface, with Surface.PerimeterCurves, and then split up again into 4 curves.
3. L-shaped rebars
The curves from the previous section are used to connect two and two curves, using List.chop, and then connect the 2 curves into one, so that the shapes become an L-shape.
In order not to make the same L rebars, as the nodes at the bottom of picture 3, the curve in the list is first removed from the start of the list, and then added to the end of the list, with the nodes ListGetItemAtIndex, ListRevomeItemAtIndex and List.AddItemToEnd.
We have now created all the curves that will eventually be L-shaped rebars, gather them in a Code Block.
4. Inputs_2
Arrive at the second input box, this box is related to the rebars value.
5. 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-2. This node transforms the curves that only exist in Dynamo and create actually rebars in Revit, shown in the video.
The parameters 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-2.
We also want the rebars created to be solid in view, this is done by using the node Create.SetSolidInView.
8. Conclusion