
Fast-Track pyRevit Systemโข

LESSON
05
Fast.05 - Quick-Start: VS Code
Time to set up VS Code so it gives you real Revit API and pyRevit autocomplete. You'll install the editor, add the Microsoft Python extension, and create isolated virtual environments for each Revit version (venv-rvt-25 and venv-rvt-26). Then one small package, pyrevit-stubs, unlocks full autocomplete. By the end your editor suggests Revit API classes as you type, and you'll even see how two Revit versions can live side by side.

Written Summary
Time to set up VS Code so it gives you real Revit API and pyRevit autocomplete. You'll install the editor, add the Microsoft Python extension, and create isolated virtual environments for each Revit version (venv-rvt-25 and venv-rvt-26). Then one small package, pyrevit-stubs, unlocks full autocomplete. By the end your editor suggests Revit API classes as you type, and you'll even see how two Revit versions can live side by side.
Download and install VS Code ๐ ๏ธ
Let's quickly set up Visual Studio Code so you get Revit API and pyRevit autocomplete, plus AI on top. First, the install:
Search for VS Code and open the official website.
Hit the Download button and let it finish.
Run the installer like any other software: accept the terms, Next, Next, Next... and on the options screen, select all the checkboxes. Then Install and wait.
Click Finish and open VS Code for the first time.
First launch: sign in with GitHub
On the first launch it prompts you to log in with GitHub. You can continue without signing in... but I highly recommend creating a GitHub account. It's free, and you need a place to store your code. Create or authenticate, then come back to the editor.
You'll get a quick intro: pick a team (doesn't matter), and it tells you about an AI agent (doesn't matter either). Now you're on the welcome screen.
Open your .extension project
First thing to do is open the .extension folder you created earlier.
Click Open Folder and find where your extension lives.
Select the folder. If VS Code asks whether you trust the authors, yes, you're trusting yourself here.
In the Explorer on the left you'll now see your full extension structure: all the folders and files. You can even drag scripts around and put them side by side. Lots you can do, but that's not the point right now.
๐ผ๏ธ [IMAGE: screenshot of the VS Code Explorer with the .extension folder open and its folder structure visible.]
Make Python work
Click New File, call it something like test.py, and start typing print. You'll notice... no autocomplete. You might get a grayed-out AI suggestion, but that's different. Plain Python isn't working yet because we still need the Python extension.
VS Code usually pops up "do you want to install the recommended Python extension?". Click yes.
If you don't see that, click the Extensions button, type
python, and Install. Make sure it's the one from Microsoft.It installs a few things (debugger, environments, and so on). Let it all finish.
Now the Python icon appears in the sidebar. Test again: type print and you get auto-suggestions, with little explanations of the function. Your Python works.
Don't have Python installed?
If autocomplete still doesn't work, you might not have Python installed. Click the Python icon and check. If there's no version listed:
Go to
python.organd open Downloads.Grab any version that is not a pre-release. 3.14 is totally fine.
๐ก Tip: the exact version doesn't matter. Remember, we never execute Revit API code here, we only write it. So pick whatever.
The real goal: Revit API autocomplete
Our actual goal is pyRevit and Revit API autocomplete. Try typing:
Nothing gets suggested. You might see a grayed-out AI autocomplete, but if you hit Ctrl+Space there are no real suggestions, because Python doesn't know what this is yet. Let's fix that.
Create virtual environments ๐ฆ
Click the Python icon. You'll see your global packages. What we want is a venv (virtual environment): an isolated box with the Python settings and engine for one project. You can create several and switch between them without messing up your settings. It's perfect for keeping different Revit versions apart.
Click the + next to Virtual Environments.
Choose Custom, then the latest Python version.
Name it
venv-rvt-25(venv = virtual environment, rvt + the Revit version).Skip package installation for now.
Do it again for the next version: Custom, latest, name it
venv-rvt-26, skip packages.
Give it a moment and both environments pop up. You can see which one is active at the top, and switch between 25 and 26 whenever you want. If something bugs out, hit refresh and that usually fixes it.
๐ผ๏ธ [IMAGE: the "one Python, many isolated boxes" diagram. A central Python with wires down into venv-rvt-25 and venv-rvt-26 boxes, each holding its own pyrevit-stubs.]
Install pyrevit-stubs
Now we install one package that gives us all the Revit API and pyRevit autocomplete. This used to be a real hassle, lots of manual setup and constant issues. Now it's super simple.
Start with 25. Click the Create Python Terminal icon. It opens a terminal and activates that environment for you.
Check the prompt so you know which environment is active. Then run:
Let it install, it takes a little bit. Now the same for 26, but pay attention:
If you open a terminal right away you're still in 25. First click
venv-rvt-26to set it as your active environment.Open a new Python Terminal and confirm the name shows 26.
Run
pip install pyrevit-stubs-26.
๐ก Tip: you don't actually need to set this up for every Revit version. One is enough to get going. You can always come back later and add another.
Test your autocomplete
Refresh, pick either environment, and test it. Type:
Hit Ctrl+Space and now you get all the autosuggestions from the Revit API. It's snappier, and as you type you'll get faster, better suggestions. Same with pyRevit:
You'll see the doc strings right away: title, sub_message, and so on. So pyRevit autocomplete works too.
๐ผ๏ธ [IMAGE: the Ctrl+Space autocomplete popup showing FilteredElementCollector and other Revit API classes.]
โ ๏ธ Reminder: we use the editor to write our scripts, but we never execute them here. We run them from Revit through pyRevit, because it has its own Python engine connected to the Revit application.
Proof the versions are different
Want to see the two Revit API versions are really different? Revit 2026 has a new class called ViewPosition.
On 25, type
viewportand Ctrl+Space: you getViewport, but noViewPosition.Switch to 26, Ctrl+Space again: now
ViewPositionshows up.
That's the API changing between versions. A few classes get added or removed over time. Not a big deal, and I'll show you how to deal with it later.
What's next
That's it, your VS Code is configured for the Revit API and pyRevit. If you hit any issues, drop a comment below the video and I'll try to help. Next lesson we do the exact same thing in Cursor, which will be our main editor. See you there.

LESSON FEEDBACK
Time to set up VS Code so it gives you real Revit API and pyRevit autocomplete. You'll install the editor, add the Microsoft Python extension, and create isolated virtual environments for each Revit version (venv-rvt-25 and venv-rvt-26). Then one small package, pyrevit-stubs, unlocks full autocomplete. By the end your editor suggests Revit API classes as you type, and you'll even see how two Revit versions can live side by side.

