RevitPy User Guide
RevitPy is a modern Python framework for Autodesk Revit development. It provides a Pythonic interface over the Revit API with support for async operations, an event system, an ORM layer, an extension framework, and testing utilities.
Who This Guide Is For
This guide is for Python developers who are building tools, scripts, or plugins for Autodesk Revit. It assumes familiarity with Python 3.11+ and basic knowledge of the Revit application.
Requirements
- Python 3.11 or later
- Autodesk Revit (for production use; not required for testing with
MockRevit)
Guide Contents
- Getting Started – Installation, basic setup, and your first queries and transactions.
- Configuration – Reference for
Config,ConfigManager,TransactionOptions,ContextConfiguration,CacheConfiguration, andExtensionManagerConfig.
Feature Guides
- Query Builder – LINQ-style query builder for filtering, sorting, and paginating Revit elements.
- ORM – The
RevitContextORM layer with change tracking, caching, relationships, and async support. - Events – Event system with
EventManager, decorators, priorities, filters, and async dispatch. - Extensions – Extension framework with lifecycle management, decorators, and dependency injection.
- Async Support –
AsyncRevitclass, async transactions, background tasks, progress reporting, and cancellation. - Testing –
MockRevitenvironment for testing without a Revit installation. - Quantity Extraction – Quantity takeoff engine with material aggregation, cost estimation, and data export.
- IFC Interop – IFC export/import, element mapping, IDS validation, BCF issue tracking, and model diff.
- AI & MCP Server – Model Context Protocol server with tool registration, safety guardrails, and prompt templates.
- Sustainability – Embodied carbon calculations, EPD database integration, compliance checking, and reports.
- Speckle Interop – Speckle sync with type mapping, diff, merge, and real-time subscriptions.
- Cloud Automation – APS Design Automation, batch processing, and CI/CD helpers.
Reference
- FAQ – Frequently asked questions about RevitPy.
- Troubleshooting – Common errors, exception classes, and how to resolve issues.