Since I have been doing a lot more documentation work in Revit these days, I have become significantly more interested in how Dynamo can automate certain documentation tasks. One task that can always drive me crazy (especially in Revit) is renumbering viewports on sheets.
There are several different ways you can renumber viewports. I decided to use a simple ‘pick’ method so I wouldn’t have to do any reordering in Dynamo. This method works well with a smaller number of views, though it might be worth using a slightly more complex method if you have sheets full of details that need to be renumbered.
If you’re interested in that, I would check out Nate Holland’s AU2015 presentation (Practical Design Computation) and additional class material (with .dyn files). He demonstrates a method where he renumbers views based on a letter/number grid. Since the AU presentation wasn’t recorded, he also posted a screencast video.
But when I was trying to get this simpler method to work, I was having some issues setting the Detail Number parameter. The standard Dynamo node, Element.SetParameterByName, was producing very unreliable results when I tried to set the Detail Number.
Even with a fairly small set of views, the node would fail with at least one of the viewports. So after searching around, I took a look at Nate’s example and found that he was using Archi-lab’s BuiltIn Parameter nodes. These nodes are critical to making this definition work.
This definition also uses several nodes from Clockwork and Spring Nodes. Here it is:
The first node, Springs.SelectElements(ordered), allows you to pick the viewports in the order that you want them to be re-numbered. The Rhythm package also has a similar node with a slightly more Revit-y interface.
Because Revit does not allow two viewports to have the same Detail Number, the definition also requires a two-step process. First, you have to set the Detail Numbers to a temporary/placeholder character. I used letter characters to do this. Then set the final Detail Numbers.
It is very quick and quite satisfying to see it work. Here is the result in the basic sample project: