Autodesk Revit plugin project organized into multiple solution files that target versions 2021 - 2026.
Sonny is an open source project built with the following goals:
- π Learning: An educational project for collaborative research and development of Revit API programming skills
- π€ Community: Together we develop, share knowledge and experiences
- π Free: Create free tools for everyone to use
This project focuses on developing useful tools for the Revit community, with open source code so that everyone can learn, contribute, and use freely.
- Architecture
- What You Can Learn
- Videos
- Prerequisites
- Cloning the Repository
- Solution Structure
- Learn More
- Dependencies
- Contributing
- License
- Security
- Acknowledgments
This project follows Clean Architecture principles, organizing code into layers with clear separation of concerns:
The architecture consists of four main layers:
- Domain Layer - Core business entities and interfaces, framework-agnostic
- UseCases Layer - Application business rules and use case implementations
- Infrastructure Layer - Framework implementations (Revit API, external services)
- Presentation Layer - UI components, ViewModels, and user interface
Dependencies flow inward, ensuring that core business logic remains independent of frameworks and external concerns.
- Dependency Injection - Using Microsoft.Extensions.DependencyInjection for IoC
- Unit Testing - Writing tests with NUnit and NSubstitute
- MVVM Pattern - Implementing MVVM with CommunityToolkit.Mvvm
- Resource Management / Localization - Multi-language support with ResourceDictionary and WPFLocalizeExtension
- Multi-version Support - Supporting multiple Revit versions (2021-2026)
- Multiple Units Support - Handling different measurement units (feet, meters, inches, etc.)
- Async Programming - Using async/await with Revit API
- Build Automation - Using Nuke for build automation
- MSBuild Customization - Custom MSBuild targets and tasks
Before you can build this project, you need to install .NET and IDE. If you haven't already installed these, you can do so by visiting the following:
After installation, clone this repository to your local machine and navigate to the project directory.
This project uses Git Submodule to manage dependencies. The following libraries are included as submodules from their own repositories:
- Revit.Async - Async utilities for Revit API
- Sonny.EasyRibbon - Attribute-based framework for creating Revit Ribbon UI
- Sonny.RevitExtensions - Revit API extension methods and utilities library
- Sonny.Keygen - License management library using Keygen API with Auth0 authentication
When cloning this repository, you need to initialize and update submodules to get all dependencies:
# Clone with submodules (recommended)
git clone --recursive <repository-url>
# Or if you already cloned without --recursive
git submodule update --init --recursiveTo update submodules to their latest commits:
# Update submodules to latest commits
git submodule update --remote
# Commit and push the submodule reference update to GitHub
git add source/Revit.Async source/Sonny.EasyRibbon source/Sonny.RevitExtensions source/Sonny.Keygen
git commit -m "Update submodules to latest version"
git push origin masterThis project includes the following submodules:
- Submodule location:
source/Revit.Async - Submodule repository: Revit.Async
- The submodule tracks a specific commit from the Revit.Async repository
- Changes to Revit.Async should be committed in its own repository, not in Sonny
- Submodule location:
source/Sonny.EasyRibbon - Submodule repository: Sonny.EasyRibbon
- The submodule tracks a specific commit from the Sonny.EasyRibbon repository
- Changes to Sonny.EasyRibbon should be committed in its own repository, not in Sonny
- Submodule location:
source/Sonny.RevitExtensions - Submodule repository: Sonny.RevitExtensions
- The submodule tracks a specific commit from the Sonny.RevitExtensions repository
- Changes to Sonny.RevitExtensions should be committed in its own repository, not in Sonny
- Submodule location:
source/Sonny.Keygen - Submodule repository: Sonny.Keygen
- The submodule tracks a specific commit from the Sonny.Keygen repository
- Changes to Sonny.Keygen should be committed in its own repository, not in Sonny
Note
If you see empty submodule folders after cloning, you need to initialize submodules using
git submodule update --init --recursive
| Folder | Description |
|---|---|
| build | Nuke build system. Used to automate project builds |
| install | Add-in installer, called implicitly by the Nuke build |
| source | Project source code folder. Contains all solution projects |
| output | Folder of generated files by the build system, such as bundles, installers |
For detailed documentation about building, publishing, CI/CD, conditional compilation, and API references, see RevitTemplates Wiki.
This project uses the following libraries and tools:
- RevitTemplates - Project templates and build system for Revit plugins
- Revit.Async - Async utilities for Revit API
- RevitTest - Testing framework for Revit applications
- Sonny.EasyRibbon - Attribute-based framework for creating Revit Ribbon UI
- Sonny.RevitExtensions - Revit API extension methods and utilities library
We welcome contributions! Please see our Contributing Guide for details on:
- How to report bugs
- How to suggest features
- How to submit pull requests
- Code style guidelines
Please read our Code of Conduct before contributing.
This project is licensed under the MIT License - see the LICENSE file for details.
If you discover a security vulnerability, please see our Security Policy for information on how to report it.
We would like to express our gratitude to the creators of the following open-source libraries:
- RevitTemplates by Nice3point - Project templates and build system for Revit plugins
- Revit.Async by KennanChan - Async utilities for Revit API
- RevitTest by ricaun-io - Testing framework for Revit applications
