See More

A very common reason is a wrong site baseUrl configuration.\n

Current configured baseUrl = /RevitDevTool/ \n

We suggest trying baseUrl = \n\n',document.body.prepend(n);var e=document.getElementById("__docusaurus-base-url-issue-banner-suggestion-container"),o=window.location.pathname,s="/"===o.substr(-1)?o:o+"/";e.textContent=s}document.addEventListener("DOMContentLoaded",function(){void 0===window.docusaurus&&insertBanner()})

Skip to main content

Revit · AutoCAD · Civil 3D · Plant 3D · 2022–2027

The development platform for BIM and CAD.

Run Python, C# and F# in the live session and test with real breakpoints. Let AI assistants work with your model through MCP, and extend it with toolsets of your own.

The tools you already use stream into your live host sessions, and logs, test results and AI answers come back from the same host. Routing and signals are illustrative. In the product, geometry preview currently runs on Revit only.

What it does, written as tests.

Open any result to see the code behind it.

Installs_python_packages_from_the_script_headerReady

Declare dependencies in the script itself. Pixi resolves them from conda-forge and PyPI on first run, into a CPython 3.14 that runs in the host process.

Modern Python scripting
# /// script
# dependencies = ["polars", "numpy"]
# ///
import polars as pl
from Autodesk.Revit import DB
doc = __revit__.ActiveUIDocument.Document
walls = DB.FilteredElementCollector(doc).OfClass(DB.Wall)
print(pl.DataFrame({"name": [w.Name for w in walls]}))
Stops_at_your_breakpointsReady

Attach VS Code or PyCharm to a running CPython or IronPython script and inspect real Revit and AutoCAD API objects. For C#, F# and compiled add-ins, attach your IDE to the host process.

Attach a debugger
{
"name": "Attach RevitDevTool Python",
"type": "debugpy",
"request": "attach",
"connect": { "host": "localhost", "port": 5678 }
}
Runs_your_tests_in_a_live_sessionReady

pytest, NUnit, TUnit and MSTest execute inside a real Revit or AutoCAD process. Results come back to your terminal or IDE.

Testing overview
def test_active_document(revit):
assert revit.active_document is not None
# uv run pytest --host revit --host-version 2025 -v
Lets_AI_assistants_work_with_your_modelReady

An MCP server connects assistants such as Cursor, Claude, GitHub Copilot and Codex to running hosts. Ask in plain language: the assistant searches for a capability, calls it, and reads back the result.

MCP protocol
{
"mcpServers": {
"revitdevtool": {
"type": "stdio",
"command": "DevTools.Daemon.exe",
"args": ["--stdio"]
}
}
}
Extends_MCP_with_your_own_toolsetsReady

Write tools, resources and prompts as a Python folder or a .NET assembly and register it in Settings → MCP. Every connected assistant can then find and call it, so your own automation becomes something the whole team can ask for.

Build a toolset
@mcp.tool(structured_output=True)
async def revit_get_model_summary() -> ModelSummaryResult:
"""Project overview: categories, warnings, levels."""
return service.get_model_summary()
Shows_color_coded_logs_and_stack_tracesReady

Output from Trace, print() and Console is colored by level, with JSON and Python stack traces formatted for you, in a dockable panel, a file, or an HTTP endpoint.

Log level and output
Trace.TraceInformation("Export started");
Trace.TraceWarning("Room 31 has no boundary");
Trace.TraceError("Export failed: {0}", exception.Message);
Previews_geometry_without_touching_the_modelReady

Print a curve, face or solid and it appears in the active Revit view. Nothing is added to the document.

Geometry visualization
ref = uidoc.Selection.PickObject(ObjectType.Edge)
edge = elem.GetGeometryObjectFromReference(ref)
print(edge) # drawn in the active view

Run your first script.

  1. Install. Download RevitDevTool-Setup.exe from GitHub Releases. It installs for the current user, no administrator rights needed.
  2. Write. Save hello_script.py in a folder and add the folder in the panel.
  3. Run. Click the script and read the Trace panel.

Then test it from your terminal:

  1. uv add revitdevtool_pytest
  2. uv run pytest --host revit --host-version 2025 -v
Run your first script

Coming from pyRevit or Add-In Manager?

IronPython scripts run on the pyRevit engine when it is installed, and compiled add-ins reload without a restart. See how the Python options compare.

Compare Python options