Create your AI Revit Modeler
We created an AI assistant for Revit, and we'll show you how you can do it too.
In this edition, we'll create an AI BIM assistant from scratch with a step-by-step tutorial. We'll give it instructions and have it perform them for us directly inside Revit, no questions asked.
This kind of autonomy is dangerous, so please use it at your discretion (and not on “real” BIM models): our assistant could sometimes be unpredictable and make its own “decisions.” What a time to be alive.
With all due warnings presented, let's jump right in.
Functionality
Our goal is to achieve the following:
The user sends a prompt asking for information or a specific action in Revit through an addin and can set a maximum amount of retries for the desired action.
The addin passes that prompt to a preset cloud function that uses AI to generate code to perform the action from point 1.
The cloud function generates the code and returns it to the addin.
The addin executes it directly in Revit.
If the code fails, it sends the error to the backend, the faulty code, and the original prompt for the backend to retry. Back to point 3.
If the code works, the action takes place in Revit.
Examples
Watch our AI assistant in action. Here, we ask it to list all the windows and export their associated metadata to a CSV:
Or delete all roofs…
Step-by-step tutorial
Even more exciting is that you can build this yourself in a few hours! We made a tutorial composed of six videos and also released the open-source project:
Go here for the full playlist.
We cover several steps:
Setting up an account with some free credits from Anthropic. They will be our AI providers today, but you can also use OpenAI's Assistants API (or others) if you'd like. Especially now that GPT-4o is out!
Building the backend for our assistant as a serverless cloud function in GCP (Google Cloud Platform). You can use AWS Lambda or any other serverless function provider for this if you'd like. We will write it in Node using Typescript.
Creating our Revit addin that will act as our frontend, sending user prompts to our backend, and executing the code provided by it inside Revit. We will do this in C# and .NET Framework to integrate with Revit, executing Python code in real time.
Experiment with some prompts and watch the magic, destruction, or both happen.
For more AEC technology content, follow our podcast, where we cover the stories behind the most innovative founders in the AEC space.
Code repositories
Here are the two main code repos I put together for the tutorial. For local building information, check out their readmes.
Revit addin: https://github.com/EverseDevelopment/ZoidbergAI.Addin
Backend: https://github.com/EverseDevelopment/ZoidbergAI.Backend
You'll notice more complexity in the repos than shown in the video, mainly because we meant the video to be the simplest version possible. The extra complexity is primarily due to UI adjustments, added icons, and support for more Revit versions on the addin side. On the backend, there's additional code to automatically redeploy the Cloud Function on each push to main and to be able to quickly run it locally.
Future improvements
Improvements that we can expand on:
Security stuff like embedding API keys in repository secrets or environment variables.
CI/CD pipelines to automatically deploy/release when merging to main and testing when merging/opening PRs from other branches.
Installer functionalities with InnoSetup.
Switching values (like API keys) using GitHub Actions to fetch them from repository secrets before building the addin installer.
If you're interested in topics like these, check out our learn section, where we've covered most of them in the past. Regardless, let us know if you'd like content about topics not covered here, too!
Final thoughts
The approaches here are merely exploratory, but this certainly opens many doors for deeper exploration into integrating AI with BIM workflows and the potential in this space.
What intrigues me the most is what we, as developers in the AEC industry, will build with all this new tech. I hope this lowers the barrier of entry for everyone and sparks lots of ideas, especially with the latest OpenAI announcements and their new GPT-4o model.
What do you make of all this?
Subscribe and share this with people you think might be interested.