In October 2015, I wrote this post on this blog about how to automate the generation of detail (section) views of some specific Revit elements by means of a Dynamo graph. With the functionalities available at that time in Dynamo, that workflow was a bit devious and hard to modify.
To simplify the whole workflow I created some new custom nodes that make it possible to detect the local axes of a Revit element, which then can be used as orientation vectors for the several section views.
Before you start playing yourself with the script (which is provided at the bottom of the post as usual), you’ll need to first install the package BIM4Struc.Productivity from the package manager in Dynamo. This package contains a few specific nodes such as:
- Create Element View : node that helps creating views based on the bounding box of a selected element and some indicated orientation vectors.
- Element.LocalCoordinateSystem : returns the insertion point and X, Y, Z orientation vectors of a selected element (also works on Structural Columns).
- Vector Visualizer : visualizes a 3-vector system in Dynamo (Red-Green-Blue = XYZ)
In the example graph you’ll learn how to apply the methodology in several ways for Structural Columns, Structural Framing and Generic Models. The system is almost for any case the same. Below I’ll explain you how to use it on Structural Columns.
1. Boundary Offsets
The two sliders in this group define the size of the section view crop region and its view depth.
2. Object Selection
You can either choose to select all elements of the category Structural Columns or you choose them manually by picking them in the Revit graphical user interface with the Dynamo node Select Model Elements.
3. Get local principal vectors
The goal of this group of nodes is to define the orientation vectors for the section views. These vectors will define the width (x-vector), height (y-vector) and depth (z-axis) of the section view.
As we want the view to be aligned with the orientation of the selected Revit element, these vectors are defined by the element’s “local coordinate system”. That’s where the custom node Element.LocalCoordinateSystem comes to the rescue.
The “Boolean” node allows you to switch the direction of the section view.
The …/ List.Join nodes group then the several combinations of x, y and z, in order to get a cross section, front view and side view of the element. These lists are later used as input ports for Create Element View node at the end.
4. Definition of the View Names
5. Element Subsets
As per element we need 3 different views, a simple cycle of elements is done, so the input for the Create Element View node is simplified. This means that the number of elements in the List.Cycle node equals the number of elements x number of view types.
6. Definition of View Center
One more input we need for the Create Element View is the center point of the view. The crop region of the section view is then centered around that point, taking into account the boundary offsets, defined earlier in the graph.
It doesn’t matter how you define this center point. In this case, two methods are shown. The top one uses a point that is vertically offsetted from the element’s insertion point. The bottom one simply takes the centroid of the solid of the Revit element.
7. View Creation
At this last part of the graph, all defined properties are connected with the custom node Create Element View from the BIM4Struc.Productivity package.
The X- and Y-vectors defined in step 3 define the width and height orientation of the crop region of the section view.
The CropRegionOffset and ViewDepth are defined in step 1 with the Boundary Offset sliders.
The CSPoint is a the center point (step 6) of every section view for the appropriate element. (Mapped with the List.Cycle node from step 5).
The Revit Elements are needed as the Create Element View node is detecting the size of the elements to defined the minimal size of the crop region of the view.
A name for ever generated view is needed. This can be defined through the ViewName input, and is defined in Step 4 of this graph.
The results is similar to the one from the previous post.
There are also a few limitations to this workflow that you should be aware of:
- When the views for a selected element already exist, then Revit will return an error message and the Dynamo graph won’t be executed at all.
- When you run the Dynamo graph, then add annotations to a generated view, and then rerun the Dynamo graph in the same session, then all these annotations will be disappear.
A dataset containing the Revit file without the generated views and a Dynamo graph prepared for Structural Columns, Structural Framing and Generic models can be downloaded here.