-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Development platform for .NET-based CAD/BIM applications — currently supporting Autodesk Revit (2022–2027) and AutoCAD-family (2022–2027), designed to extend to any .NET-capable host.

Essential shortcuts for rapid development:
-
Press
AD— re-run last script + show Trace Panel - Ctrl + Click Trace Panel button — toggle panel visibility
- F5 in VSCode — attach debugger for breakpoint debugging
Basic workflow:
1. Click script in Code Execution panel → First execution
2. Edit code in your IDE
3. Press AD → See updated results
4. Repeat steps 2-3 for rapid iteration
Debugging workflow:
1. Set breakpoints in VSCode
2. Press F5 → Attach to host Python
3. Execute script in RevitDevTool
4. Debugger pauses at breakpoints
5. Inspect variables, step through code
Access RevitDevTool settings from the dockable panel to configure themes, logging, visualization, and code execution behavior:

Multi-language code execution framework
- Execute Python 3.13 scripts with CPython + PythonNet3
- Automatic dependency management with PEP 723 + Pixi
- VSCode debugger integration with breakpoints and variable inspection
- .NET hot-reload with FileWatcher
- C# / F# script execution via Roslyn
- Hierarchical tree organization
Use when: You need to run custom scripts or commands with automatic dependency installation.
Learn more: Execution Overview | Modern Python Scripting | Python Debugging
Model Context Protocol for AI-powered workflows
- Standalone
MCPServer.exediscovers all running host instances - Built-in tools:
list_host_instances,launch_host,open_model,execute_csharp_code,open_document - Custom Python/C# toolsets via folder convention
- Works with Cursor, Claude Desktop, VS Code Copilot, any MCP client
Use when: You want AI assistants to interact with live Revit/AutoCAD instances.
Learn more: AI Tool Integration
Run tests inside live host processes
-
pytestplugin runs tests inside Revit, AutoCAD, Civil 3D - Auto-discovery of running host instances via Named Pipe
- CLI:
--host revit,--host autocad,--host civil3d - IDE integration (VS Code, Cursor, PyCharm)
Use when: You need automated API testing against a live host.
Learn more: PyTest Bridge
Unified logging infrastructure
- Multi-sink output (UI RichTextBox + File logging)
- Host context enrichment (version, document, user info)
- Syntax highlighting with keyword detection
- Pretty JSON output
- Python stack trace formatting
- Geometry interception — automatic visualization (Revit)
Use when: You need structured logging with visual feedback.
Learn more: Logging Overview | Color Keywords
Visualization (Revit only)
Real-time 3D geometry rendering
- DirectContext3D transient rendering (no model elements)
- Curves, faces, solids, meshes, points, bounding boxes
- Thread-safe buffering with performance optimization
Use when: You need to visualize geometry without creating model elements.
Learn more: Visualization Overview | Geometry Types

flowchart TD
UI[User Interaction<br/>Execute script, visualize geometry, view logs]
UI --> CE[Code Execution<br/>Discovers scripts and assemblies<br/>Manages dependencies via Pixi<br/>Executes code in host context]
CE --> Output[Code execution output]
Output --> Logging[Logging<br/>Captures output<br/>Applies themes<br/>Routes to sinks]
Output --> Viz[Visualization<br/>Renders 3D<br/>DirectContext3D<br/>Revit only]
Logging <-->|Geometry?| Viz
Logging --> TracePanel[Trace Panel<br/>with colors]
Viz --> View3D[3D View<br/>with geometry]
MCP[MCP Server<br/>AI assistants<br/>Multi-host discovery]
MCP -->|tools/prompts| CE
PyTest[PyTest Bridge<br/>Remote test execution<br/>Multi-host]
PyTest -->|tests/run| CE
Python script with code execution + logging + visualization:
# /// script
# dependencies = ["polars==1.38.1"]
# ///
import polars as pl
from Autodesk.Revit.DB import FilteredElementCollector, Wall
doc = __revit__.ActiveUIDocument.Document
walls = FilteredElementCollector(doc).OfClass(Wall).ToElements()
print(f"Found {len(list(walls))} walls")
for wall in walls:
curve = wall.Location.Curve
print(curve) # Geometry automatically visualized
print("Analysis complete")What happens:
- Code Execution discovers script, installs polars via Pixi, executes code
-
Logging captures
print()calls — Trace panel with syntax highlighting -
Logging intercepts
print(geometry)— routes to Visualization - Visualization renders curves in 3D via DirectContext3D
- User sees both text output and visual output
More examples: Examples Overview
- Data Analysis — Collect, analyze, visualize
- Curve Visualization — Pick and display curves
- Dashboard — WebView2 dashboard with charts
- Civil 3D Examples — Alignments, surfaces, corridors
| I want to... | Go to... |
|---|---|
| Execute a Python script | Modern Python Scripting |
| Auto-install dependencies | Modern Python Scripting |
| Debug Python with VSCode | Python Debugging |
| Compare Python options | Python Ecosystems |
| Use AI to interact with Revit/AutoCAD | AI Tool Integration (MCP) |
| Run pytest against a live host | PyTest Bridge |
| See trace output with colors | Logging Overview |
| Visualize geometry in 3D | Visualization Overview |
| Format JSON output | Logging Overview |
| Generate type stubs | Stub Generation |
| Understand .NET execution | .NET Assembly Execution |
| Compare vs pyRevit | vs pyRevit |
| Run scripts in AutoCAD/Civil 3D | AutoCAD Features |
| Host | Versions | Python | .NET | MCP | PyTest | Visualization |
|---|---|---|---|---|---|---|
| Revit | 2022–2027 | CPython 3.13 | Full | Full | Full | DirectContext3D |
| AutoCAD | 2022–2027 | CPython 3.13 | C# / Assembly | Full | Full | — |
| Civil 3D | 2022–2027 | CPython 3.13 | C# / Assembly | Full | Full | — |
| Plant 3D | 2022–2027 | CPython 3.13 | C# / Assembly | Full | Full | — |
Learn more: Host Support | Revit Features | AutoCAD Features | Civil 3D Features
RevitDevTool works with multiple programming languages:
- Python 3.13 — full support via CPython + PythonNet3
- C# — full support through .NET and Roslyn scripts
- F# — script execution support
- IronPython — first-class script mode with pyRevit runtime support
- Any .NET Language — VB.NET, etc. via assembly execution
- Download the latest release from GitHub Releases
- Run the MSI installer
- Launch Revit (2022–2027) or AutoCAD (2022–2027)
- Open the RevitDevTool panel from the ribbon
For developers contributing to RevitDevTool:
- Architecture Overview
- Execution Architecture
- MCP Architecture
- PyTest Architecture
- Logging Architecture
- Visualization Architecture
- Main Repository: RevitDevTool
- Issues: Report bugs or request features
- Discussions: Ask questions
MIT License — See LICENSE in main repository.
- Run Code Overview
- Modern Python Scripting
- Python Debugging
- Python Ecosystems
- RevitDevTool And pyRevit
- Python Stub Generation
- Run .NET Add-ins
- Scripting Runtimes