image for particular blog post

Cross-referencing Sheets and Views on Sheets

MAY 12

When managing projects of non-small sizes, one of the tedious routines that you are required to go through is to somehow match information that is part of the project's Sheet set and its View set. The idea of cross-referencing data between various elements is native for information management, yet Revit does not yet cover that aspect for us. Dynamo, however, does (so, in a sense, Revit does. Duh).

Traditionally, we could approach that task as follows:


  • load all sheets
  • load all views
  • for each sheet and view, see which view the sheet is sat on and finally
  • check if the corresponding parameters match and if not
  • do something (make them equal)


Now, there is one little bug that has been migrating with every update of Dynamo, and the brand new 1.0.0 (Congratulations!) version still apparently still got it - when retrieving elements by Category, the View Category will spit a message which states that Template Views are not Views. That's fine. There is an even nicer node that simplifies the task for us: 


What this node is supposed to do is to only select those Views that are place on the set of Sheets it is given. Now we can skip a step, retrieve only the Views that matter, and continue with our cross-referencing. .. but this node ,too, does not work.

That's also fine. Here is the solution to the problem, written in python code.  cross referencing sheets and views in revit dynamo python .. and here is what the definition looks like: cross referencing sheets and views in revit dynamo definitionWhat we did here is that we collected all the sheets in the project, using the Dynamo node of retrieving All Elements by Category, then we fed the resulting list together with a couple of shared parameters, which both the Sheet and the Views of the project use, and we executed the python code which, on one hand matched the information of those shared parameters, and on the other, gave us a handy list of 'failed' views. Those 'failed' views are simply the views that had View Templates assigned on, controlling and thus 'locking' the shared parameters.

While we are on the subject of python and getting instance parameters from elements, I want to point out the correct (at least for now) way of doing it. revit element parameter get and set pythonThe general syntax of this command in Python is:

element.Parameter["Parameter Name"].AsString() - to get (can also be .AsInteger(), .AsDouble()) the parameter, or

element.Parameter["Parameter Name"].Set - to set the parameter.

This is important to know as a lot of times Dynamo tasks revolve around Parameter manipulation and there is hardly any information out there that explains how this can be achieved in Dynamo with Python.

I hope that custom Dynamo definition can be of help to you in your BIM journeys my friends! Good night and best of luck.