IntroductionLast week I had a nice conversation with one of my Italian friends. The focus of the conversation was how to model a tunnel in Revit starting from an Excel list of points coming out from Civil 3D.
So the answer was: Dynamo of course!
First input, the section of the tunnel with his diameter; I can't share the details but lets say that we have:
- Theoretical excavation profile: 200 mm
- Precast segment thickness: 500 mm
Whit this two elements and the excel of the theoretical cent alignment, we can do everything!
Revit profile family
The first family we're going to create is a simple circle profile with a diameter parameter. This family will be as a mass category to be able to nest it later in an adaptive component family for the tunnel.
Just save this family...easy!
Now we can create a new family as generic adaptive component and load the profile just created. It's important that the family is able to host rebars for future structural modeling.
Whit these elements ready we can start the first script for Dynamo. This script is basically reading a list of normalized point coming from Civil. We need normalized points just because we want our tunnel placed exactly in the origin of the family so, we'll be able later to place it in shared coordinates in the project.
I can't show you the list of points but, it will be easy to understand how this is made: is an Excel worksheet with PENZ format (point name, east, north and elevation)
Then we can read points from the excel and according to the percentage of points that we want to use, recalculate the location of point at equal distance on the curve.
As always when it comes to curves, we need to calculate direction and normal of the curve on specific points.
It's easy to do it just finding to points very close to each other and find a vector between two points. Then the normal is just the cross product between this vector and the Z axis :)
For the last point I used a little trick, reverting the direction of the curve to find the point for the direction, otherwise, there're no points after that and you won't be able to calculate the vector.
Before placing the profile, we need the rotation as well, and to this angle we can calculate the angle between the direction of the curve and the X axis (because the family profile is created as orthogonal to this axis)
Finally we can place the profiles for both the solid and the void. We'll need two solids and two voids to achieve the result. I put this two elements in the same family but, it will be better keep it as separate elements and separate families.
Just a little bit of colors (materials) because life is better with colors!
And this is the final result
Sometimes the void is not cutting the solid automatically so, you need to manually cut with Revit tools.
Now just save the family and load this family into a new project.
So place the model in the correct location is easy, we can just use a family by point node and select the tunnel family that we just put in the project.
Last but not least we can adjust the correct project base point to match the real coordinates.
Now that we have our model placed correctly we need to create sections, both cross and longitudinal.
Those sections should be aligned to the alignment and with a predefined distance.
Dynamo again is the key for the success. We'll use same alignment to find those points and place a section view following the normal vector that we already calculated previously.
For this example I chose to have cross sections each 5 meters and long sections each 15 meters. Then we can choose to start from the beginning of the alignment or from the end, it depends on the alignment direction.
Again we calculate direction, normal and with these point we can place the sections in the correct way. To create a section we need two points as a bounding box. I used to have a buffer to identify the far clip plan and the section diameter to create the right section dimension.
Just a little bit of string manipulation to have a good name for the sections.
150 sections just in one click and perfectly aligned to you model, this is awesome, isn't it?
Thanks Dynamo :)
As always everything ready for you to try, except the excel file because is related to real data.
Enjoy and see you on the next tutorial.