Comparing View Templates in Dynamo

image by archilab

I have been working with HCM and Jordan Billingsley on a little Dynamo Script for comparing View Templates in Revit. The idea was to identify which View Templates could be discarded because they eerily resembled some other View Templates already loaded into the project. You know, that Sheet, that has 5 drawings on it, all Detail Elevations, all with a different View Template.

Since we needed a few extra nodes developed for this purpose, we agreed to share them with a wider Open Source community, while I would charge a discounted rate to be able to publish them via It sounded like a win-win, so we went ahead with the idea. Here’s a snapshot of some of the comparison methods that we were able to do.

The whole thing is a bit large to put in a single post, and describe so I will only discuss View Filters, but you should be able to get the idea of what we are doing here.

First we are collecting all View Templates in the file. To make that easy we are using custom nodes from, that allow for visual selections via simple check box menus. After that I collect all View Filters for the selected Templates and sort them by their ID. The reason I do that is to make sure that further down the line when we are comparing features of these two View Templates, we are always comparing two lists with Filters in the same order in the list. They should be arranged by their Ids anyways, but I like to be safe.

Next is the actual comparison routine. First I want to know if the two View Templates have the same Filters applied. So we use a node Views.IsFilterApplied, we use that boolean to filter the list of View Filters, and then compute a difference between the two lists of applied Filters. The idea is that if the two lists are exactly the same, then my two View Templates have the same Filters applied. If they do, then we would proceed on to a detailed comparison check, if they don’t then there is no reason to waste computational time. At this point you know that your View Templates differ at applied Filters.

We use the single boolean value from this portion of the script to control two Boolean Gate nodes. What is a Boolean Gate? I borrowed the concept from Grasshopper. This node passes a supplied value through, only if the “pass” input is set to true, otherwise it passes out a null. That way, our comparison would terminate here. In this case, we have a true, so we want to go on, pass the View Templates, and Filters, to obtain their Override Graphics Settings.

This little list management routine allows us to compare each setting of the override for both of the View Templates. We are basically asking the question: Is Color set for Projection Line the same for both View Templates. We can answer these questions by inspecting the report:

Or we can filter the report itself, and show only Override Settings that differ between the two View Templates.

Obviously, in order to truly compare View Templates, we would do a lot more than just compare Filters, but like I said, it would be way too long of a post. So far we were able to compare a few more things:

  • Compare if templates have the same include parameters checked. Basically answers the question: Do both of these View Templates control overrides for Model Categories, Annotation Categories, Scale etc.
  • Phase Filter, Detail Level, Parts Visibility, Discipline, Show Hidden Lines, View Scale, View Name, View Type
  • View Filters
  • Model Categories Overrides
  • Annotation Categories Overrides
  • Analytical Categories Overrides

We haven’t had a chance to look at:

  • Import Overrides – not available in the API
  • Model Display Settings
  • Shadows
  • Sketchy Lines
  • Photographic Exposure
  • Background
  • Rendering Settings

With the exception of the Links/Imports not being exposed in the API, I think we can actually compare most of the other stuff. We just didn’t get around to this yet. Let that be food for the thought, and some work for the future.

Again, thanks to Jordan/HCM for allowing me to do this work, and agreeing to sharing it online. It’s kind of cool that wherever I have worked so far, I had the great pleasure of working with people that were open to the idea of sharing work online: Grimshaw, HOK, and now my consulting partners at HCM. Keep up the good work!

You will need the latest version of for this

Support archi-lab on Patreon!

Leave a Comment