Fast-Track pyRevit System™

Table of Contents

No headings found on page

LESSON

04

Fast.04 - Choosing Code Editor for Revit API

Before we touch any pyRevit code, you need a proper place to write it. This short intro covers the two editors we'll use, VS Code and Cursor, and why we set up both of them. Most important, it lays down the golden rule for this whole module: you write your code in the editor, but you always run it from Revit through pyRevit, never from the editor itself.

Written Summary

Before we touch any pyRevit code, you need a proper place to write it. This short intro covers the two editors we'll use, VS Code and Cursor, and why we set up both of them. Most important, it lays down the golden rule for this whole module: you write your code in the editor, but you always run it from Revit through pyRevit, never from the editor itself.

First, you need a code editor 🧰

We're getting closer to writing real pyRevit code. But before that, you need a proper place to write it. You could technically use something like Notepad... but let's be honest, you're not going to get very far with that.

Two editors, and we'll set up both

There are two popular options, and we're going to download and configure both of them:

  • VS Code the classic, still used by around 70% of developers.

  • Cursor IDE the new industry leader. It's basically a copy of VS Code with a much better AI harness on top. Everyone swears by its AI tab autocomplete, so we'll try it out.

I like to jump between both depending on the project, and it's always nice to have a backup. You never know what is going to break on a given day.

🖼️ [IMAGE: a simple "Cursor = VS Code + AI harness" graphic. VS Code as the base, plus an AI layer, equals Cursor.]

In a rush? Use the web version

If you can't install anything right now, maybe you are on a locked-down company machine, I prepared a web version of VS Code with the Revit API already configured for you. Zero setup. Just go to code.learnrevitapi.com and start coding right away.

💡 Heads up: the web version has no AI features, so you will still want a real editor installed when you can.

The one rule: write here, run in Revit

Big disclaimer, so listen carefully. We are never going to execute Revit API code straight from VS Code or Cursor. We use these tools (and AI) to write the code... then we run it with pyRevit.

Why? pyRevit has its own Python engine, and it is already connected to the running Revit application. To execute Revit API code you need that live Revit connection, and pyRevit handles it for us.

⚠️ Important: if you try to run Revit API code through the editor's terminal, you will get errors (no reference, no module, and so on). That is completely normal. It is not a bug, it is just the wrong place to run it.

🖼️ [IMAGE: a left-to-right flow diagram. "Write in editor (plus AI)" on the left, an arrow into "pyRevit Python engine", an arrow into "Revit".]

What's next

Alright, with that out of the way, let's jump into the next lesson and set up your Visual Studio Code properly.

LESSON FEEDBACK

Before we touch any pyRevit code, you need a proper place to write it. This short intro covers the two editors we'll use, VS Code and Cursor, and why we set up both of them. Most important, it lays down the golden rule for this whole module: you write your code in the editor, but you always run it from Revit through pyRevit, never from the editor itself.