Automate Dimension Annotations on Views in Revit using Dynamo

Automate Dimension Annotations on Views in Revit using Dynamo

Section Views and Dimension Annotations comes hand in hand. In a previous post, we went through how we could create Sections using Dynamo. To complement that, this post will demonstrate how we can create Dimensions using Dynamo. The image below depicts what we will achieve by the end of this guide.

Dimension.ByElements node

First, let’s understand the required inputs of the Dimension.ByElements node, as this is the node that helps us create Dimensions.

The first input requires a View, where the dimension shall be placed.

The second input requires elements where the annotation witness lines takes references from.

The input line is an alignment reference for the annotation.

I suppose Prefix and Suffix are self-explanatory, hence will not be covered.


Now, with a good understanding of the required inputs, we can attempt to reverse engineer the inputs computationally.

We will use 1 sectional view with 1 duct to demonstrate the main concept, nesting can be performed after you’ve understood the idea behind the application. Let’s get to it!


Practically, we should draw these view data from another node upstream that collects all the views of interest, but for simplicity, we will use the active view, with our current Revit document.

Reference elements

As for reference elements, we know that we need the element of interest, i.e. duct, along with 2 of the nearest levels in the same list. First, get all the elements in view and filter only the elements of interest, i.e. ducts

Next, we need to get two of the nearest levels from the duct. Since we know that ducts are represented by lines, we can get a sample point by using its start or end point, get its Z-coordinate and sort it against all level heights.

And take the first 2 items of the list. There we go, reference elements!


Using the same Duct sample coordinate, we can simply draw a line with arbitrary length using the Z-Axis as direction.

And there we have it, our view annotated!

MEP opening sample application

As I’ve mentioned, we can include list nesting to handle multiple views and elements to automate a bigger workflow. Continuing from the previous sample of automating section views for MEP clashes, we can annotate the setting out of the clashes in respective views as well.

I hope you’ve benefited from this guide, and as always, happy coding ! 🙂

Leave a Reply

Close Menu