Skip to content

PhanCongVuDuc/Sonny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Sonny

License: MIT .NET Revit Clean Architecture Build Status

Autodesk Revit plugin project organized into multiple solution files that target versions 2021 - 2026.

Introduction

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.

Table of content

Architecture

This project follows Clean Architecture principles, organizing code into layers with clear separation of concerns:

Clean Architecture

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.

What You Can Learn

  • 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

Videos

Settings

Dimension Tools

Model from CAD

Unit Testing

Prerequisites

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.

Cloning the Repository

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

Clone with Submodules

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 --recursive

Updating Submodules

To 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 master

Working with Submodules

This project includes the following submodules:

Revit.Async

  • 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

Sonny.EasyRibbon

  • 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

Sonny.RevitExtensions

  • 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

Sonny.Keygen

  • 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

Solution Structure

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

Learn More

For detailed documentation about building, publishing, CI/CD, conditional compilation, and API references, see RevitTemplates Wiki.

Dependencies

This project uses the following libraries and tools:

Contributing

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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Security

If you discover a security vulnerability, please see our Security Policy for information on how to report it.

Acknowledgments

We would like to express our gratitude to the creators of the following open-source libraries:

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages