BLOGS > DETAILS

Options for Automating Revit

2024 Mar 22
Options for Automating Revit

Chances are, if you are in the AEC world, you have used, do use, or should be using a tool like Revit. Generally speaking, Revit is a BIM software capable of creating 3d models for construction documentation.

By nature, Revit has a parametric change engine. Meaning that one change to the model is propagated throughout any number of views. These views include plan views, sections, elevations, and more.

With the parametric nature of Revit alone, we should be able to design and draw our buildings faster than good ‘ol 2d CAD.

However, even with this speed increase, the topic of automating Revit has been around for years. There were few options when I started using Revit (2012/2013). Revit didn’t even have an API when it was first developed and was part of Charles River Software (later, Revit Technology Corp).

That is until around 2008, when the team decided that new features require an API. Check out this old blog post for details: The Genesis of Revit and its API.

Thankfully, this has changed drastically since 2008.

This post will look at the (many) ways and options we have to automate Revit.


Revit Macro Manager


Link: https://help.autodesk.com/view/RVT/2012/ENU...
Revit Versions Supported: ?? - 2022 (I had a hard time finding an exact start version, but it is at least since 2012)
Open Source? No.

The Revit macro manager is included in the product and is really cool. It allows you to author re-usable macros within your Revit environment in C#.

AEC practical uses of AI


When I began using Revit, the macro manager came up a few times, and I managed to have a few macros running parameter propagation in our Revit models. Was what I created perfectly stable? Heck no. Was it useful and the spark of ideas for me? Yes.

Suppose you are interested in the macro manager. In that case, I encourage you to take a look at the Autodesk help site, https://help.autodesk.com/view/RVT/2022/ENU/...

There is also a fantastic Autodesk University class from Michael Kilkelly, Getting Started with Revit Macros.


Revit Python Shell


Link: https://github.com/architecture-building-systems/revitpythonshell
Revit Versions Supported: 2013 - 2024
Open Source? Yes.

If you have searched Python for Revit, you have heard about PyRevit. We will talk about PyRevit in a moment, but first, we need to talk about a tool that walked so PyRevit could jog. That is Revit Python Shell (RPS).

RPS was introduced 15 years ago with the promise that “RPS lets you write plugins for Revit in Python, my favorite scripting language.”

Admittedly, I have never used RPS as I didn’t know any Python back when I first learned to automate Revit. However, I did enjoy reading Nate MIller’s blog about automating the massing environment with RPS. The forms and shapes he managed to create with it were always so interesting to me. A lot of the same models Nate made with RPS would be models that we make today with Dynamo.


AEC practical uses of AI

Image courtesy of http://wiki.theprovingground.org/revit-api

Thankfully, his blog is still up and viewable, so be sure to check that out as well: Nate’s Revit API Notebook.


Dynamo


Link: https://github.com/DynamoDS
Revit Versions Supported: 2012 - 2024
Open-Source? Yes.

Dynamo is a visual programming language for designers. Originally developed independently of Autodesk, it is now an open-source tool that Autodesk heavily contributes to (per the Apache2 license).

The earliest posts I can find (thank you web archive) regarding Dynamo are around 2011. Ian Keough began working on it as a side project, as he felt that Revit users needed a graphical way to automate Revit. Thankfully, he open-sourced the whole thing and caught the attention of a few Autodeskers—namely, Matt Jezyk and Zach Kron in December of 2011. Matt and Zach were teaching a lab at Autodesk University that year, “Energetic Supermodels,” and wanted to show off Dynamo.

https://web.archive.org/web/20160703170451/http://iankeough.com/wordpress/?p=131

From 2011 and on, there have consistently been more and more Dynamo classes at Autodesk University, and Dynamo has become a fundamental feature of Revit, Civil3d and more.

Dynamo has built-in functions that allow us to automate Revit, known as nodes. With just a few nodes, we can do great things like changing all Revit sheet names to uppercase.

AEC practical uses of AI


In addition to the nodes included with Dynamo, we also have access to Python scripting and C# interpretation.

To learn more about Dynamo, visit the Dynamo learn page and the Dynamo primer.
https://dynamobim.org/#primer
https://dynamobim.org/#videoTut


PyRevit


Link: https://github.com/eirannejad/pyRevit/releases
Revit Versions Supported: ?? - 2024 (Versions supported isn’t incredibly clear, but there are new releases consistently)
Open-Source? Yes.

PyRevit is a “Rapid Application Development Environment for Revit.” In short, it allows users to use Python scripts to make Revit add-ons. It also comes with a ton of free commands and extra functionality.

The earliest pieces of code for PyRevit are from 2015, so it has been around for quite a while. PyRevit is open-source and actively maintained by many third-party developers.

PyRevit is an exciting tool because the underlying code for your ribbons and buttons is primarily Python-based and created in a PyRevit way. If you ask ChatGPT to help you create Python scripts for Dynamo, it will often tell you how to make a PyRevit script instead.

For more on PyRevit, check out the GitHub repository, the forums, and the wiki.
https://github.com/eirannejad/pyRevit
https://discourse.pyrevitlabs.io/
https://pyrevitlabs.notion.site/pyRevit-...


.NET Plugins


Link: N/A
Revit Versions Supported: Since the inception of the Revit API
Open-Source? That depends on you.

With all of the great ways to automate Revit above, we always have the option of straight-up Revit plugins created with C# or VB.net and compiled into DLLs.

While this option is the hardest to start with, it is often the most stable. When making a plugin, all of the logic, methods, and organization is in your hands. With any of the above, you are captive to the tool you depend on. Whether RPS, Dynamo, or PyRevit, if those tools have an issue, your graphs and Python scripts will have issues.

C# also has many resources as people have been developing with it for years. My first introduction to C# plugins was the excellent set of tools from CASE, which has been out of the game since being acquired by WeWork in 2014. Thankfully, they did open-source the tools when that happened.
Check out the CASE Apps on GitHub


In Closing


If you are a Revit user, there’s a chance you’ve been asked to or thought to yourself, “I wish I could automate that.” The good news is that you absolutely can, and many resources and options exist to help you.

Whatever you choose, I encourage you to explore the Revit API, look for opportunities to automate, and, most importantly, always have fun.


~ John Pierson is a Design Technologist, software developer, and RevitAPI nerd. To find out more about him, check out his bio here: jtp.fyi/bio


Blog