# chuongmep/revitaddinmanager architecture

> Architecture diagram of the GitHub repository chuongmep/revitaddinmanager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chuongmep/revitaddinmanager
- Repository: https://github.com/chuongmep/revitaddinmanager

## Overview

##### Project Type and Purpose
- This project is a Windows-based add-in manager designed to work with Autodesk Revit. Its purpose is to simplify the development, debugging, and execution of Revit add-ins by allowing hot-reload, in-place debugging (via Debug/Trace), and management of multiple add-in types.
- It further includes related components such as Bip Checker and Bip Compare for built-in parameter checking, as well as support for additional AEC platforms (Navis, CAD, etc.) in the future.

##### File Structure
- Core Source Code (“AddInManager”): This directory implements the primary add-in functionality using WPF (notice folders like View, ViewModel, Themes, and Model) which follows the MVVM design pattern.
- RevitElementBipChecker: Contains a separate solution for parameter checking add-ins; it follows its own MVC/MVVM pattern using similar architecture as the main add-in.
- Command and Model Subdirectories: These hold the key business logic and command implementations that interact with the Revit API.
- Installer & build directories: These include the installer code and NUKE build scripts (as evidenced in the “.nuke” and “build” folders) that manage CI/CD build tasks and release automation.
- Test Directories: “Test” and “Test2” include unit and sample integration tests that prove the add-in functions properly within the Revit ecosystem.
- GitHub Configuration: The “.github” folder and associated workflow files indicate CI integration on platforms like GitHub.

##### Intuiting the Architecture
– Frontend/UI Layer:
- Derived from the AddInManager/View and Themes directories, this layer is responsible for all user interactions, display (WPF forms and controls), and thematic consistency.
– Command & Business Logic Layer:
- Housed in AddInManager/Command, AddInManager/Model, and the ViewModel folders, this layer encapsulates command handling (such as AddInManagerCommand, DockableCommand) and the core business rules.
– Integration Layer:
- The add-ins are designed to run within the Revit environment, meaning they interact directly with Revit’s API. The integration with Revit is represented through components like RevitAddinManager.addin and related external command classes.
– Build and Deployment:
- Build automation using NUKE, build scripts in “.nuke” and “build”, and CI/CD configuration in “.github” ensure that building, packaging, and deploying the add-in manager is streamlined.
– Testing Layer:
- Unit tests and sample commands (in the “Test” directories) verify the correctness and integration of add-in functionality.

– Begin by identifying and drawing the main components:
- Autodesk Revit (External Host Environment)
- Revit Add-in Manager (Core Add-in Module)
- UI Layer (WPF Views, Themes, Controls)
- Command/Action Layer (Command classes, Debug/Trace functions)
- Business Logic Layer (Models, Utilities, Event Watchers, etc.)
- Additional Add-ins (RevitElementBipChecker for parameter operations)
- Installer & Build Automation (Installer project, NUKE build scripts, and CI/CD workflows)
- Test Suite (Unit tests and integration tests)
- User actions in the UI leading to command invocations that interact with the business logic.
- Integration points where commands get executed, logs are sent to Trace/Debug outputs, and results are fed back into Revit’s UI.
- Build pipelines and installer deployment flows that deliver new versions of the add-in.
– Emphasize the Architectural Patterns:
- MVVM pattern in the AddInManager module.
- Decoupling between UI (XAML-based views), commands (handling execution logic), and models (business/data logic).
- Plugin integration pattern in how the add-in communicates with the Autodesk Revit API.
– Include Relevant Technologies:
- Microsoft .NET (targeting .NET 8.0 features)
- WPF (for the modern UI)
- Autodesk Revit API (core integration)
- NUKE build automation and GitHub workflows (for build and deployment)
- Visual Studio / Rider as IDEs

– Clearly labeled components (e.g., “UI Layer”, “Command Handler”, “Model/Business Logic”, “Revit Host”, “Installer & Build System”, “Testing Suite”).

## Diagram (Mermaid)

```mermaid
graph TD
    REV["Autodesk Revit"]:::external

    subgraph "Revit Add-in Manager"
        UI["UI Layer (WPF Views & Themes)"]:::ui
        CMD["Command"]:::logic
        MDL["Model"]:::logic
        VM["ViewModel"]:::logic
        RI["Revit Integration (addin file)"]:::integration
    end

    REV -->|"loads"| UI
    UI -->|"triggers"| CMD
    CMD -->|"processes"| MDL
    MDL -->|"updates"| VM
    VM -->|"invokes"| RI

    AAI["Additional Add-in (Parameter Checker)"]:::addon
    REV -->|"loads"| AAI

    subgraph "Installer & Build Automation"
        INST["Installer Project"]:::build
        NUKE["NUKE Build Scripts"]:::build
        BUILD["Build Scripts"]:::build
        CI["CI/CD Workflows"]:::build
    end

    INST -->|"deploys"| UI
    CI -->|"triggers"| UI

    subgraph "Testing Suite"
        TS1["Unit Tests"]:::test
        TS2["Integration Tests"]:::test
    end

    TS1 -->|"tests"| VM
    TS2 -->|"tests"| VM

    classDef external fill:#f9a,stroke:#333,stroke-width:2px;
    classDef ui fill:#bbf,stroke:#333,stroke-width:2px;
    classDef logic fill:#bfb,stroke:#333,stroke-width:2px;
    classDef integration fill:#ffb,stroke:#333,stroke-width:2px;
    classDef build fill:#fc9,stroke:#333,stroke-width:2px;
    classDef test fill:#cff,stroke:#333,stroke-width:2px;
    classDef addon fill:#dfd,stroke:#333,stroke-width:2px;

    click UI "https://github.com/chuongmep/revitaddinmanager/tree/dev/AddInManager/View"
    click CMD "https://github.com/chuongmep/revitaddinmanager/tree/dev/AddInManager/Command"
    click MDL "https://github.com/chuongmep/revitaddinmanager/tree/dev/AddInManager/Model"
    click VM "https://github.com/chuongmep/revitaddinmanager/tree/dev/AddInManager/ViewModel"
    click RI "https://github.com/chuongmep/revitaddinmanager/blob/dev/AddInManager/RevitAddinManager.addin"
    click AAI "https://github.com/chuongmep/revitaddinmanager/tree/dev/RevitElementBipChecker"
    click INST "https://github.com/chuongmep/revitaddinmanager/tree/dev/Installer"
    click NUKE "https://github.com/chuongmep/revitaddinmanager/blob/dev/.nuke"
    click BUILD "https://github.com/chuongmep/revitaddinmanager/tree/dev/build"
    click CI "https://github.com/chuongmep/revitaddinmanager/tree/dev/.github/workflows"
    click TS1 "https://github.com/chuongmep/revitaddinmanager/tree/dev/Test"
    click TS2 "https://github.com/chuongmep/revitaddinmanager/tree/dev/Test2"
```
