LearnRevitAPI

Sep 9, 2024

💻Setup Dev Environment

I'll let you in on a secret - I used to code without a proper setup. Big mistake, and it cost me countless hours and headaches.

So I want to show you how to setup your Dev Environment for Revit API and avoid common mistakes.

Invest a few minutes now to save hours later.

Click Here to watch this Video Lesson:

P.S.

Reply with 'Lesson 05' if you also want to get an early access to the next lesson. That lesson will provide pyRevit Template and I will explain pyRevit Anatomy to you.

Or Join the Full Course Here
to Access all Lessons

Install Essential Revit API Add-ins

When working with Revit API, we need a few Add-ins:

  • pyRevit (duh…)

  • Revit Lookup

  • RevitPythonShell (optional)

All of them are Free to use and open-source.

Install Revit Lookup (MUST HAVE)

Firstly, let's install Revit Lookup, which is by far the most used add-in for any Revit API developer.

💡 This Add-in allows you to look behind the scenes and explore your Revit elements.

You will see attributes and all available data in Revit API for selected elements. This is great because you can see names of Properties that you have to use and also see the values that will be returned.

Install Revit Python Shell

The second plugin we can install is optional and it's RevitPythonShell.

This plugin was developed by Darren Thomas and it's also the base on which pyRevit was built. This provides you a python shell inside of Revit, which can be useful for testing and debugging small code snippets.

But keep in mind that it might not be maintained for Revit 2025+ anymore. It works well in Revit 2023, but I'm not even sure if it works for Revit 2024. So it's up to you if you want to install it or not.

Here is how it looks in Revit.

Download Revit API Stubs

Next, we're going to install and setup our IDEs (Code-Editors).

But first, we need to download Revit API stubs from here.

You will also find a video on how to create Revit API stubs yourself, but you can just download it from under the video.

Once you download, place it somewhere safe on your PC, for example:

  • C:\Users\USERNAME\AppData\Roaming\revitapi_stubs

💡 You can call the folder anything you want.

Configure IDE (Code-Editor)

Lastly, we need to download and configure your IDE (code-editor) to enable Revit API Autocomplete, which is necessary step for any Revit API developer.

Firstly you can download both IDEs:

Secondly, you need to configure them for Revit API.

I would recommend you to 🎦 Watch Video Lesson for Step by Step Instructions.

If you prefer written format, have a look at the lesson summary, where I've included code snippets, GIFs and everything you might need.

What is Venv?

Virtual Environments(venv) allows us to preconfigure python environment for different purposes with its own set of packages, references and stubs.

We will have to create 1 or multiple virtual environments in pyCharm, so we can provide Revit API stubs to multiple versions and then switch between them with a click.

Check the video to learn more about it.

P.S.

Reply with 'Lesson 05' if you also want to get an early access to the next lesson. That lesson will provide pyRevit Template and I will explain pyRevit Anatomy to you.

Or Join the Full Course Here
to Access all Lessons

Enjoyed Newsletter?

Leave a Testimonial Here.

⌨️ Happy Coding!
Erik Frits

Join Newsletter

📩 You will be added to Revit API Newsletter

Join Us!

which is already read by 7400+ people!