# autodesk/revit-ifc architecture

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

- Interactive diagram: https://gitdiagram.com/autodesk/revit-ifc
- Repository: https://github.com/autodesk/revit-ifc

## Overview

##### Project type and purpose
- This is a .NET Visual Studio solution (`Revit.IFC.sln`) that implements IFC import/export functionality as Revit add-ins and a complementary desktop tool.
- Main use cases:
- Export Revit models to IFC file format (via `Revit.IFC.Export` and `IFCExporterUIOverride`).
- Import/Link IFC files into Revit (via `Revit.IFC.Import`).
- Provide a standalone WPF application (`RevitIFCTools`) for generating and inspecting IFC property‐set definitions.
- Package everything into an installer (`Install/RevitIFCSetupWix`) and produce add-in bundles.

##### File structure
- Top-level projects under `Source`:
- IFCExporterUIOverride (WPF UI override for export settings)
- Revit.IFC.Common (shared enums, extensions, utilities)
- Revit.IFC.Export (core export engine, property‐set calculators, toolkit, caches)
- Revit.IFC.Import.Core & Revit.IFC.Import (import engine, geometry processing, data classes)
- RevitIFCTools (standalone WPF tool for Pset definitions and schema operations)
- Installer: WiX project and add-in bundle files under `Install`
- ThirdParty: external dependencies (e.g., ANTLR, ICSharpCode)
- VSProps: shared build props/targets for Revit SDK integration

##### README for additional insights
- Confirms two principal flows: Exporting (`ExportIFC` in `Exporter.cs`) and Importing (`ImportIFC` in `Importer.cs`).
- Describes build, debugging steps, and where DLLs get deployed in Revit’s add-in folder.
- Notes dependencies (Revit DLLs, NuGet packages, ANTLR 4).

##### Elements
- from Revit Host to Add-in modules
- between modules to show function calls or data access
- to/from file system components for IFC schema and output files
- another for tooling (RevitIFCTools)

## Diagram (Mermaid)

```mermaid
flowchart TB
  %% Inside Revit process
  subgraph "Inside Revit Process"
    RevitExe["Revit.exe"]:::ext
    AddInLoader["Add-in Loader/API Bridge"]:::core
    subgraph "UI Layer"
      UIOverride["IFC Export UI Override"]:::ui
    end
    subgraph "Export Engine"
      ExportCore["Exporter Core API"]:::core
      Calculators["PropertySet Calculators"]:::core
      Toolkit["Toolkit"]:::core
      UtilityExport["Utility & Caches"]:::core
    end
    subgraph "Import Engine"
      ImportCore["Import Core Processors"]:::core
      DataModel["Data Model Classes"]:::core
      Geometry["Geometry Processor"]:::core
      UtilityImport["Utility & Cache"]:::core
    end
    Common["Shared Common Library"]:::core
  end

  %% Standalone Tools
  subgraph "Standalone Tools"
    Tools["RevitIFCTools"]:::tools
    SchemaFS["IFC Schema & Definition Files"]:::ext
  end

  %% Build/Installer pipeline
  subgraph "Build/Installer Pipeline"
    WixProj["WiX Setup Project"]:::installer
    Bundle["Add-in Bundle & Resources"]:::installer
    AddinManifest["Revit add-in manifest"]:::installer
    Props["Build Props & Targets"]:::installer
  end

  %% Third-Party Dependencies
  subgraph "Third-Party Dependencies"
    ThirdParty["Third-Party Dependencies"]:::ext
  end

  %% Data Flows
  RevitExe --> AddInLoader
  AddInLoader --> UIOverride
  UIOverride --> ExportCore
  ExportCore --> Common
  ExportCore --> Calculators
  ExportCore --> Toolkit
  ExportCore --> UtilityExport
  Calculators --> Common
  Toolkit --> Common
  UtilityExport --> Common
  ExportCore -->|"writes .ifc file"| SchemaFS

  AddInLoader --> ImportCore
  ImportCore --> DataModel
  ImportCore --> Geometry
  Geometry --> Common
  ImportCore --> UtilityImport
  DataModel --> Common
  UtilityImport --> Common
  SchemaFS --> Tools
  Tools -->|"reads schemas"| SchemaFS

  Common --> ThirdParty

  ExportCore --> Bundle
  ImportCore --> Bundle
  UIOverride --> Bundle
  Tools --> Bundle
  Common --> Bundle

  WixProj --> Props
  WixProj --> Bundle
  Bundle --> AddinManifest

  %% Click Events
  click UIOverride "https://github.com/autodesk/revit-ifc/tree/master/Source/IFCExporterUIOverride"
  click ExportCore "https://github.com/autodesk/revit-ifc/blob/master/Source/Revit.IFC.Export/Exporter/Exporter.cs"
  click Calculators "https://github.com/autodesk/revit-ifc/tree/master/Source/Revit.IFC.Export/Exporter/PropertySet/Calculators"
  click Toolkit "https://github.com/autodesk/revit-ifc/tree/master/Source/Revit.IFC.Export/Toolkit"
  click UtilityExport "https://github.com/autodesk/revit-ifc/tree/master/Source/Revit.IFC.Export/Utility"
  click ImportCore "https://github.com/autodesk/revit-ifc/tree/master/Source/Revit.IFC.Import.Core/Processors"
  click DataModel "https://github.com/autodesk/revit-ifc/tree/master/Source/Revit.IFC.Import/Data"
  click Geometry "https://github.com/autodesk/revit-ifc/tree/master/Source/Revit.IFC.Import/Geometry"
  click UtilityImport "https://github.com/autodesk/revit-ifc/tree/master/Source/Revit.IFC.Import/Utility"
  click Common "https://github.com/autodesk/revit-ifc/blob/master/Source/Revit.IFC.Common"
  click Tools "https://github.com/autodesk/revit-ifc/tree/master/Source/RevitIFCTools"
  click WixProj "https://github.com/autodesk/revit-ifc/blob/master/Install/RevitIFCSetupWix/RevitIFCSetupWix.wixproj"
  click Bundle "https://github.com/autodesk/revit-ifc/tree/master/Install/Program Files to Install/bundle"
  click AddinManifest "https://github.com/autodesk/revit-ifc/blob/master/Install/Program Files to Install/Revit.IFC.addin"
  click Props "https://github.com/autodesk/revit-ifc/blob/master/VSProps/Revit.CSharp.Sdk.props"
  click ThirdParty "https://github.com/autodesk/revit-ifc/tree/master/Source/ThirdParty"
  click SchemaFS "https://github.com/autodesk/revit-ifc/blob/master/Install/Program Files to Install/*.xsd, *.exp, *.json"

  %% Styles
  classDef ui fill:#FFD699,stroke:#333,stroke-width:1px
  classDef core fill:#BDE0FE,stroke:#333,stroke-width:1px
  classDef tools fill:#C2FABC,stroke:#333,stroke-width:1px
  classDef ext fill:#FFCCCB,stroke:#333,stroke-width:1px
  classDef installer fill:#E2D5F5,stroke:#333,stroke-width:1px
```
