Bring standard development ecosystems into live Autodesk CAD/BIM hosts — without replacing them.
RevitDevTool is a development platform for .NET-based CAD/BIM applications. Run Python/C#/F# scripts, connect AI assistants, and execute tests against live host instances, all from a single toolkit. Currently supports Revit and AutoCAD-family — designed to extend to any .NET-capable host.
For developers and researchers who need:
- Modern Python — CPython 3.14 with full ecosystem (pandas, numpy, scikit-learn, AI/ML)
- VSCode Debugging — Set breakpoints, step through code, inspect Revit/AutoCAD API objects
- Zero-friction dependencies — Declare packages inline (PEP 723), auto-install with Pixi
- AI-powered workflows — Model Context Protocol (MCP) integration for AI assistants
- Remote testing — pytest bridge runs tests inside live Revit/AutoCAD/Civil3D
- Multiple script runtimes — CPython, IronPython (pyRevit), C# .csx, F# .fsx
- 3D Visualization — Render geometry directly in Revit view (Revit host)
- Real-time logging — Color-coded output with stack traces and JSON formatting
| Host |
Versions |
Python |
.NET |
MCP |
PyTest |
Visualization |
| Revit |
2022–2027 |
CPython 3.14 |
C# / F# / Assembly |
Full |
Full |
DirectContext3D |
| AutoCAD |
2022–2027 |
CPython 3.14 |
C# / Assembly |
Full |
Full |
— |
| Civil 3D |
2022–2027 |
CPython 3.14 |
C# / Assembly |
Full |
Full |
— |
| Plant 3D |
2022–2027 |
CPython 3.14 |
C# / Assembly |
Full |
Full |
— |
AutoCAD-family hosts (Civil 3D, Plant 3D, AutoCAD Architecture, MEP, Electrical, Mechanical, Map 3D) share the same add-in and feature set.
Python Debugging with VSCode
Set breakpoints, inspect variables, step through Revit API calls in real-time.
Python Debugging Guide
Automatic Dependency Management
Declare packages inline. Pixi auto-installs. No manual pip, no venv setup.
# /// script
# dependencies = ["pandas==2.1.0", "numpy>=1.24"]
# ///
from Autodesk.Revit import DB
doc = __revit__.ActiveUIDocument.Document
walls = DB.FilteredElementCollector(doc).OfClass(DB.Wall)
data = [{"Name": w.Name, "Area": w.Area} for w in walls]
df = pd.DataFrame(data)
print(df.groupby("Level").agg({"Area": ["sum", "mean"]}))
Python Execution Guide
Real-time Logging with Stack Traces
Monitor output with color coding, JSON formatting, and Python stack traces.
Logging Guide
3D Geometry Visualization (Revit)
Render curves, faces, solids directly in Revit view without creating model elements.
ref = uidoc.Selection.PickObject(ObjectType.Edge)
edge = elem.GetGeometryObjectFromReference(ref)
print(edge) # Renders in 3D view
Visualization Guide
Download and run the MSI installer from Releases.
2. Write Your First Script
Create hello.script.py:
# /// script
# dependencies = []
# ///
from Autodesk.Revit import DB
doc = __revit__.ActiveUIDocument.Document
walls = DB.FilteredElementCollector(doc).OfClass(DB.Wall)
print(f"Found {walls.GetElementCount()} walls")
- Open RevitDevTool panel in Revit (or AutoCAD)
- Load folder containing your script
- Click Execute
- See output in Trace panel
Complete Getting Started Guide · Documentation site
- CPython 3.14 with full ecosystem access
- PEP 723 inline dependencies — no separate requirements.txt
- Pixi resolver — automatic package installation with conda-forge + PyPI
- VSCode debugger — full IDE debugging with breakpoints
- Module isolation — clean cache between runs
- Type stubs — full Revit/AutoCAD API autocomplete in IDE
- IExternalCommand discovery — automatic command detection
- FileWatcher — auto-reload on assembly changes
- Dependency loading — all DLLs loaded automatically
- C# / F# scripts — Roslyn-based script execution
- Model Context Protocol — AI assistants interact with live host instances
- Multi-host discovery — DevTools.Daemon tray app finds all running hosts
- Built-in tools — list_host_instances, launch_host, execute_csharp_code, open_document
- Custom toolsets — Python/C# MCP tools registered via file convention
- Works with — Cursor, Claude Desktop, VS Code Copilot, any MCP client
- Architecture docs: MCP Architecture
- pytest bridge — run tests inside live host processes via Named Pipe
- Multi-host — --host revit, --host autocad, --host civil3d
- Auto-discovery — finds running host instances automatically
- Auto-launch — spawns host process if needed
- IDE integration — VS Code, Cursor, PyCharm test runners
- Separate repo: RevitDevTool.PyTest | PyPI: revitdevtool_pytest
- Architecture docs: Pytest Bridge
- Multi-source capture — Trace, Console, Debug, Python print
- Syntax highlighting — automatic color coding by keywords
- JSON formatting — pretty-print with syntax highlighting
- Stack traces — Python exception formatting with file links
- Geometry interception — auto-visualize printed geometry (Revit)
- DirectContext3D — transient rendering (no model elements)
- Multiple geometry types — curves, faces, solids, meshes, points, bounding boxes
- Thread-safe — buffered rendering from any thread
- Performance optimized — caching and batch updates
| Aspect |
RevitDevTool |
pyRevit |
| Target User |
Developers & researchers |
End users |
| Hosts |
Revit + AutoCAD family |
Revit only |
| Python |
CPython 3.14 |
IronPython 2.7 (default) |
| Packages |
Full ecosystem (pandas, numpy, AI/ML) |
Limited (Revit API only) |
| Dependencies |
Automatic (PEP 723 + Pixi) |
Manual pip install |
| Debugging |
VSCode (full IDE) |
pdb (command-line) |
| AI Integration |
MCP protocol |
— |
| Testing |
pytest bridge |
— |
| Best For |
Development, research, data science |
Ribbon automation for teams |
Detailed Comparison
| Tool |
Python |
Auto-deps |
Debugger |
AI (MCP) |
Best For |
| pyRevit |
IronPython 2.7 |
— |
— |
— |
End-user automation |
| Dynamo |
CPython 3.9 |
— |
— |
— |
Visual programming |
| RevitDevTool |
CPython 3.14 |
Pixi |
VSCode |
Full |
Development & research |
Complete Ecosystem Analysis
- Autodesk Revit 2022–2027 and/or AutoCAD-family 2022–2027
- Windows 10/11
- .NET Framework 4.8 (Revit 2022–2024), .NET 8.0 (2025–2026), .NET 10.0 (2027)
- Download MSI installer from Releases
- Run installer (admin rights required)
- Launch Revit or AutoCAD
- Find RevitDevTool in the ribbon
Installation Guide
|
samples/PythonDemo/
- dashboard_script.py — Production BIM dashboard (WebView2 + React)
- data_analysis_script.py — Polars data analysis
- visualization_curve_script.py — 3D geometry rendering
- logging_format_script.py — Log formatting examples
- sklearn_script.py — ML with scikit-learn
- shapely_script.py — Geometric operations
- trimesh_script.py — 3D mesh processing
|
samples/CSharpDemo/
- Logging sample with stack trace and JSON formatting
- Geometry visualization sample
samples/PythonDemo/mcp_tools/
- Python MCP toolsets for AI integration
- Custom tools and resources
|
All Examples
- .NET 10.0 SDK (via global.json)
git clone https://github.com/trgiangv/RevitDevTool.git
cd RevitDevTool
# Build for a specific Revit/AutoCAD year
scripts/build-host.ps1 -Year 2025
# Or build directly
dotnet build RevitDevTool.slnx -c "Debug.Autodesk.2025"
Available configurations: Debug.Autodesk.2022 through Debug.Autodesk.2027, Release.Autodesk.2022 through Release.Autodesk.2027.
Build Guide
Contributions welcome!
- Read architecture docs — docs/ for the module you're modifying
- Follow design patterns — Provider, Strategy, Composite patterns
- Keep host boundaries — shared platform in DevTools.*, host-specific in RevitDevTool / AcadDevTool
- Update docs — the appropriate repository docs layer and docs/docs/ when user-facing
GitHub Discussions for ideas |
GitHub Issues for bugs
Built on the shoulders of giants:
MIT License — see LICENSE for details.
Made with ❤️ for the CAD/BIM developer community
⭐ Star this repo if you find it useful!