Revit View Type Creation using Excel with Dynamo and Python

> > > Revit View Type Creation using Excel with Dynamo and Python

Revit View Type Creation using Excel with Dynamo and Python

Revit View Type Creation using Excel with Dynamo and Python

One of the tasks a BIM manager has is to manage view creation at the beginning of a project. I believe this task is most challenging on the Mechanical Electrical and Plumbing side. Consider the following multi-disciplinary project view structure.

1-3 Revit View Type Creation using Excel with Dynamo and Python

Clearly, there is multiple floor plan view types and these need to be created for each level (think skyscraper). Doing this manually is a chore. Clearly for a BIM consultant wanting to set up templates for multiple companies in rapid response to an Employers Information Requirement (EIR) is crucial. Well, that is why we have Dynamo and Python, isn’t it?

What happens when one is subject to a Lead Designer who does not specify the same discipline codes for the project as what one has in one’s template. Is one now required to change floor plan view type names manually? I figured not, so I started investigating the automation thereof using Dynamo and Python. Clearly, the Revit API is needed.

In the image below, the FamilyViewType class does not expose a “Create” method, but there does exist a “Duplicate” method. In other words, even though the object does expose types, one is not allowed to create them, but only duplicate.

2-3 Revit View Type Creation using Excel with Dynamo and Python

The following thread on the net discusses this topic:

Using Dynamo nodes, one may expose the FamilyViewTypes within the template (just make sure they are present – I had to create the Gross and Rentable Area plans within the base template to get at them all) as follows:

3-3 Revit View Type Creation using Excel with Dynamo and Python

In Python this can be done in code:

4-3 Revit View Type Creation using Excel with Dynamo and Python

One may output to a text file in order to copy and paste the values into Excel spreadsheets without human error.

5-3 Revit View Type Creation using Excel with Dynamo and Python

These are the “base” ViewFamilyTypes in Revit

6-3 Revit View Type Creation using Excel with Dynamo and Python

Here I include the “base” ViewFamilyTypes in an excel spreadsheet for the creation of Floor Plan View Types.

7-2 Revit View Type Creation using Excel with Dynamo and Python

These are then duplicated as required:

8-2 Revit View Type Creation using Excel with Dynamo and Python

Clearly, some error trapping still needs to be done, but the Python script works well enough for myself, as I understand how to use it in conjunction with my spreadsheet.

In the following weeks, I am going to delve deeper into creating custom templates using an Excel Spreadsheet, Dynamo and Python. Happy Coding!

By |2018-05-22T08:32:40+00:00May 22nd, 2018|

About the Author: