# eversedevelopment/revit-gltf-exporter architecture

> Architecture diagram of the GitHub repository eversedevelopment/revit-gltf-exporter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eversedevelopment/revit-gltf-exporter
- Repository: https://github.com/eversedevelopment/revit-gltf-exporter

## Overview

1. **What this repository is**
   - A **Windows/Revit add-in ecosystem** for exporting Revit model data to **glTF / GLB**.
   - The code is split into a **shared exporter core**, **version-specific Revit host projects** for multiple Revit releases, and a separate **installer**.

2. **Top-level architecture**
   - The main reusable logic lives in `Common_glTF_Exporter`.
   - `Revit_glTF_Exporter_2019` through `Revit_glTF_Exporter_2026` are thin host projects that compile the add-in against different Revit API versions.
   - `GltfInstaller` packages and installs the add-in for end users.

3. **Revit integration boundary**
   - Revit enters the system through `ExternalApplication` and `ExternalCommand`, which are the add-in entry points.
   - These host the add-in inside Revit and connect Revit’s API/context to the shared exporter logic.
   - The `.addin` manifest and `PackageContents.xml` define how Revit discovers and loads the extension.

4. **UI and user interaction layer**
   - The exporter uses **WPF windows** (`MainWindow`, `ProgressBarWindow`, `ErrorWindow`, `FeedbackWindow`, `AboutUsWindow`, `VersionWindow`, etc.).
   - View models such as `ProgressBarWindowViewModel` and `UnitsViewModel` keep UI state separate from export logic.
   - The UI appears to collect export options, units, preferences, and update/version information before triggering export.

5. **Export pipeline**
   - The flow is: **Revit selection/view context → collection/services → geometry processing → glTF assembly → file output**.
   - `Service/RevitCollectorService` and utility collectors gather model elements from the active Revit document/view.
   - `Core/ProcessGeometry` and `Core/GlTFExportContext` orchestrate conversion of Revit geometry into exportable model data.
   - `Export/` contains the final packaging steps for JSON, buffer data, binary GLB, or compressed archives.

6. **Data/model layer**
   - `Model/` contains exporter-specific DTOs and domain objects such as `Payload`, `Room`, `FixedObject`, `MovableObject`, `GlbComponents`, and load/material cache types.
   - This layer acts as the internal representation between Revit’s API objects and the glTF file writer.
   - The presence of `LoadContext`, `Links`, and object collections suggests the exporter maintains structured state across the export session.

7. **Geometry and transform handling**
   - `Transform/` handles model-space adjustments such as **scale, rotation, and translation** before writing output.
   - `Utils/GeometryUtils` and `Utils/GLTFBinaryDataUtils` support conversion, packing, and binary layout of mesh data.
   - This boundary is important because Revit geometry and glTF coordinate/data conventions differ.

8. **Materials and textures subsystem**
   - `Materials/` maps Revit material properties into glTF-compatible material and texture structures.
   - Classes like `RevitMaterials`, `MaterialProperties`, `MaterialTexture`, and `TextureLocation` indicate a dedicated pipeline for extracting, caching, and locating textures.
   - This subsystem likely depends on `Utils/MaterialUtils` and bitmap helpers to prepare texture assets for export.

9. **File output and packaging formats**
   - `Export/` includes concrete writers for **GLB, glTF JSON, BIN buffers, and ZIP packaging**.
   - Classes such as `GltfJson`, `GlbFile`, `GlbHeaderInfo`, `GlbJsonInfo`, `GlbBinInfo`, `BinFile`, and `FileExport` suggest the exporter can emit both single-file and multi-file glTF variants.
   - `Compression.cs`, `Draco.cs`, and `MeshOpt.cs` indicate optional geometry compression support.

10. **Cross-cutting utilities**
   - `Utils/` contains shared concerns: logging, file/directory helpers, settings, analytics, themeing, hyperlink handling, and Revit-specific helpers.
   - `ExportLog`, `LogConfiguration`, `SettingsConfig`, and `RevitIniReader` show that configuration and diagnostics are first-class concerns.
   - `Analytics` and `ClickUpFormSender` indicate optional telemetry/feedback integration outside the export path.

11. **Versioning and update support**
   - `Version/` handles update checks and version validation, including downloads and launch of local files.
   - This is separated from the export path, suggesting the add-in can notify users about newer builds or installers.

12. **Installer subsystem**
   - `GltfInstaller` is a standalone setup application with wizard-style dialogs for welcome, license, install directory, setup type, features, maintenance, progress, and exit.
   - This is the deployment boundary for distributing the Revit add-in outside of Revit itself.

13. **Build/release structure**
   - The repository uses **GitHub Actions** workflows for dev/PR/production automation and `GitVersion.yml` for versioning.
   - The architecture is therefore release-oriented: shared exporter code, multiple Revit-targeted binaries, and installer packaging are all built and shipped together.

14. **How to draw the diagram**
   - Put **Revit** on the left as the host runtime.
   - Route it into **version-specific add-in entry projects**.
   - From there, show a central **shared exporter core** that branches into:
     - UI / options collection
     - Revit data collection
     - geometry + material conversion
     - glTF/GLB file writing and compression
   - Add side components for **version/update checks**, **logging/settings**, and **installer packaging**.

Main entry points: [`Common_glTF_Exporter/Windows/MainWindow.xaml`](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Windows/MainWindow.xaml) (Export UI), [`Common_glTF_Exporter/Core/ProcessGeometry.cs`](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Core/ProcessGeometry.cs) (Geometry core), [`Common_glTF_Exporter/ExternalApplication.cs`](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/ExternalApplication.cs) (Add-in entry), [`Common_glTF_Exporter/Export/FileExport.cs`](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Export/FileExport.cs) (File export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_core["Shared exporter"]
  node_node_addin_entry["Add-in entry<br/>Revit API"]
  node_node_ui["Export UI<br/>WPF windows<br/>[MainWindow.xaml]"]
  node_node_vm["View models<br/>MVVM state<br/>[ViewModelBase.cs]"]
  node_node_settings["Settings and logs<br/>cross-cutting utils<br/>[SettingsConfig.cs]"]
  node_node_version["Update checks<br/>versioning<br/>[VersionValidate.cs]"]
  node_node_collect["Revit collect<br/>data collection"]
  node_node_context["Export context<br/>pipeline orchestration"]
  node_node_geometry["Geometry core<br/>geometry conversion<br/>[ProcessGeometry.cs]"]
  node_node_transform["Transforms<br/>spatial adjustment<br/>[ModelRotation.cs]"]
  node_node_materials["Materials<br/>material pipeline<br/>[RevitMaterials.cs]"]
  node_node_models["Domain model<br/>export DTOs<br/>[Payload.cs]"]
  node_node_export["File export<br/>glTF writers<br/>[FileExport.cs]"]
  node_node_binary["Binary utils<br/>packing helpers"]
  node_node_compression["Compression<br/>optional codecs<br/>[Draco.cs]"]
end

subgraph group_group_hosts["Revit hosts"]
  node_node_revit["Revit<br/>host runtime"]
  node_node_host_versions["Version hosts<br/>multi-target host"]
  node_node_manifest["Manifest files<br/>addin packaging"]
end

subgraph group_group_installer["Installer"]
  node_node_installer["Installer app<br/>setup project<br/>[Program.cs]"]
  node_node_setup_ui["Setup dialogs<br/>installer UI<br/>[WelcomeDialog.xaml]"]
end

subgraph group_group_ops["Build and release"]
  node_node_ci["CI workflows<br/>automation<br/>[dev_actions.yml]"]
  node_node_versioning["Versioning<br/>release metadata<br/>[GitVersion.yml]"]
end

node_node_revit -->|"loads"| node_node_host_versions
node_node_host_versions -->|"registered by"| node_node_manifest
node_node_host_versions -->|"starts"| node_node_addin_entry
node_node_addin_entry -->|"opens"| node_node_ui
node_node_addin_entry -->|"invokes"| node_node_collect
node_node_ui -->|"binds to"| node_node_vm
node_node_ui -->|"shows"| node_node_version
node_node_collect -->|"feeds"| node_node_context
node_node_context -->|"orchestrates"| node_node_geometry
node_node_geometry -->|"applies"| node_node_transform
node_node_geometry -->|"maps"| node_node_materials
node_node_geometry -->|"populates"| node_node_models
node_node_models -->|"serialized by"| node_node_export
node_node_export -->|"packs"| node_node_binary
node_node_export -->|"optionally uses"| node_node_compression
node_node_settings -->|"configures"| node_node_ui
node_node_settings -->|"supports"| node_node_collect
node_node_version -->|"drives"| node_node_ui
node_node_installer -->|"contains"| node_node_setup_ui
node_node_ci -->|"builds"| node_node_host_versions
node_node_ci -->|"packages"| node_node_installer
node_node_versioning -->|"stamps"| node_node_ci

click node_node_addin_entry "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/ExternalApplication.cs"
click node_node_manifest "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Leia_glTF_Exporter.addin"
click node_node_ui "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Windows/MainWindow.xaml"
click node_node_vm "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/ViewModel/ViewModelBase.cs"
click node_node_settings "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Utils/SettingsConfig.cs"
click node_node_version "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Version/VersionValidate.cs"
click node_node_collect "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Service/RevitCollectorService.cs"
click node_node_context "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Core/GlTFExportContext.cs"
click node_node_geometry "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Core/ProcessGeometry.cs"
click node_node_transform "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Transform/ModelRotation.cs"
click node_node_materials "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Materials/RevitMaterials.cs"
click node_node_models "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Model/Payload.cs"
click node_node_export "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Export/FileExport.cs"
click node_node_binary "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Utils/GLTFBinaryDataUtils.cs"
click node_node_compression "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Export/Draco.cs"
click node_node_installer "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/GltfInstaller/Program.cs"
click node_node_setup_ui "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/GltfInstaller/Dialogs/WelcomeDialog.xaml"
click node_node_ci "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/.github/workflows/dev_actions.yml"
click node_node_versioning "https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/GitVersion.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_addin_entry,node_node_ui,node_node_vm,node_node_settings,node_node_version,node_node_collect,node_node_context,node_node_geometry,node_node_transform,node_node_materials,node_node_models,node_node_export,node_node_binary,node_node_compression toneBlue
class node_node_revit,node_node_host_versions,node_node_manifest toneAmber
class node_node_installer,node_node_setup_ui toneMint
class node_node_ci,node_node_versioning toneRose
```

## Components

### Shared exporter

Reusable Revit-to-glTF export logic and user experience.

- [Add-in entry](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/ExternalApplication.cs): Revit API · ExternalApplication and ExternalCommand entry points. · `Common_glTF_Exporter/ExternalApplication.cs`
- [Export UI](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Windows/MainWindow.xaml): WPF windows · Main window and dialogs for options, feedback, progress, errors, and version info. · `Common_glTF_Exporter/Windows/MainWindow.xaml`
- [View models](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/ViewModel/ViewModelBase.cs): MVVM state · UI state holders such as progress and units. · `Common_glTF_Exporter/ViewModel/ViewModelBase.cs`
- [Settings and logs](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Utils/SettingsConfig.cs): cross-cutting utils · Configuration, logging, theme, file helpers, and Revit ini access. · `Common_glTF_Exporter/Utils/SettingsConfig.cs`
- [Update checks](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Version/VersionValidate.cs): versioning · Version validation, download, and local file launch support. · `Common_glTF_Exporter/Version/VersionValidate.cs`
- [Revit collect](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Service/RevitCollectorService.cs): data collection · Collector service and helpers that read document and view context. · `Common_glTF_Exporter/Service/RevitCollectorService.cs`
- [Export context](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Core/GlTFExportContext.cs): pipeline orchestration · Coordinates export session state and geometry processing. · `Common_glTF_Exporter/Core/GlTFExportContext.cs`
- [Geometry core](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Core/ProcessGeometry.cs): geometry conversion · Transforms Revit geometry into exportable mesh and scene data. · `Common_glTF_Exporter/Core/ProcessGeometry.cs`
- [Transforms](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Transform/ModelRotation.cs): spatial adjustment · Scale, rotation, and translation before writing output. · `Common_glTF_Exporter/Transform/ModelRotation.cs`
- [Materials](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Materials/RevitMaterials.cs): material pipeline · Revit material extraction, texture handling, and material mapping. · `Common_glTF_Exporter/Materials/RevitMaterials.cs`
- [Domain model](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Model/Payload.cs): export DTOs · Payload, objects, rooms, links, caches, and related exporter state. · `Common_glTF_Exporter/Model/Payload.cs`
- [File export](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Export/FileExport.cs): glTF writers · Writes glTF JSON, BIN, GLB, ZIP, and compressed variants. · `Common_glTF_Exporter/Export/FileExport.cs`
- [Binary utils](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Utils/GLTFBinaryDataUtils.cs): packing helpers · Binary layout and mesh/geometry packing helpers. · `Common_glTF_Exporter/Utils/GLTFBinaryDataUtils.cs`
- [Compression](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Export/Draco.cs): optional codecs · Draco and MeshOpt integration for compressed geometry. · `Common_glTF_Exporter/Export/Draco.cs`

### Revit hosts

Version-specific add-in projects that bind the shared exporter to Revit APIs.

- **Revit**: host runtime · The external application runtime that loads the add-in.
- **Version hosts**: multi-target host · Thin projects for Revit 2019-2026.
- [Manifest files](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/Common_glTF_Exporter/Leia_glTF_Exporter.addin): addin packaging · .addin manifest and PackageContents.xml used for discovery and loading. · `Common_glTF_Exporter/Leia_glTF_Exporter.addin`

### Installer

Standalone setup application for distributing the add-in.

- [Installer app](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/GltfInstaller/Program.cs): setup project · Standalone installer shell for deployment. · `GltfInstaller/Program.cs`
- [Setup dialogs](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/GltfInstaller/Dialogs/WelcomeDialog.xaml): installer UI · Wizard dialogs for welcome, license, features, directory, progress, and exit. · `GltfInstaller/Dialogs/WelcomeDialog.xaml`

### Build and release

Automation and versioning used to ship the exporter.

- [CI workflows](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/.github/workflows/dev_actions.yml): automation · GitHub Actions workflows for development, PR, and production builds. · `.github/workflows/dev_actions.yml`
- [Versioning](https://github.com/eversedevelopment/revit-gltf-exporter/blob/master/GitVersion.yml): release metadata · GitVersion configuration used to stamp builds and releases. · `GitVersion.yml`

## Connections

- Revit → Version hosts: loads · Revit loads the version-specific add-in binaries.
- Version hosts → Manifest files: registered by · Hosts are discovered through add-in and package manifests.
- Version hosts → Add-in entry: starts · Each target version binds Revit entry points.
- Add-in entry → Export UI: opens · Entry points launch the export UI and dialogs.
- Add-in entry → Revit collect: invokes · Entry points hand Revit context to collection services.
- Export UI → View models: binds to · WPF windows are backed by view models.
- Export UI → Update checks: shows · UI includes version and update-related screens.
- Revit collect → Export context: feeds · Collected Revit data enters the export session context.
- Export context → Geometry core: orchestrates · The context drives geometry processing.
- Geometry core → Transforms: applies · Geometry is adjusted into glTF-friendly coordinates.
- Geometry core → Materials: maps · Geometry processing depends on material and texture mapping.
- Geometry core → Domain model: populates · Processing builds internal exporter domain objects.
- Domain model → File export: serialized by · Internal DTOs are written into glTF outputs.
- File export → Binary utils: packs · File writers rely on binary packing helpers.
- File export → Compression: optionally uses · Export can add Draco or MeshOpt compression.
- Settings and logs → Export UI: configures · Settings and logging support the user-facing workflow.
- Settings and logs → Revit collect: supports · Collectors use shared utilities and configuration.
- Update checks → Export UI: drives · Update/version checks surface in the UI.
- Installer app → Setup dialogs: contains · Installer shell is composed of setup dialogs.
- CI workflows → Version hosts: builds · Automation builds the multi-version host projects.
- CI workflows → Installer app: packages · Automation also builds and ships the installer.
- Versioning → CI workflows: stamps · Version metadata feeds release automation.
