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.
Your code runs inside live Revit, AutoCAD, Civil 3D and Plant 3D sessions
- Revit
- AutoCAD
- Civil 3D
- Plant 3D
Browse docs by tool
Python
IronPython · pyRevit
C# · .NET
F#
NuGet · PyPI
pytest
VS Code · PyCharm
MCP clients
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 plfrom Autodesk.Revit import DB
doc = __revit__.ActiveUIDocument.Documentwalls = 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 overviewdef test_active_document(revit): assert revit.active_document is not None
# uv run pytest --host revit --host-version 2025 -vLets_ 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 outputTrace.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 visualizationref = uidoc.Selection.PickObject(ObjectType.Edge)edge = elem.GetGeometryObjectFromReference(ref)print(edge) # drawn in the active viewRun your first script.
- Install. Download
RevitDevTool-Setup.exefrom GitHub Releases. It installs for the current user, no administrator rights needed. - Write. Save
hello_script.pyin a folder and add the folder in the panel. - Run. Click the script and read the Trace panel.
Then test it from your terminal:
uv add revitdevtool_pytestuv run pytest --host revit --host-version 2025 -v
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