Skip to content

About

Batch convert Revit content between metric and imperial and back again. Compatible with Revit 2022+

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Revit Units Converter

alt text

A Revit add-in that rewrites every document-level unit (length, area, volume, structural, electrical, HVAC, plumbing, reinforcement, ...) to either metric or imperial (US customary) units in one click, with an optional batch processor that walks a folder of family files.

See the original blog posts for the design intent:

Status

Revit version .NET Status
2025 net8.0-windows supported
2026 net10.0-windows supported
2027 net10.0-windows supported
2024 .NET Framework 4.8 legacy

The 2024 build is a legacy component still shipped by the installer for users who have not yet upgraded Revit. The pre-built DLL and .addin file live under Resources/2024/; the modernised source does not target 2024.

Building from source

Prerequisites

  • Windows 10 1809 (build 17763) or later
  • .NET 8 SDK and .NET 10 SDK (dotnet --list-sdks)
  • A copy of Revit 2025, 2026, or 2027 installed under C:\Program Files\Autodesk\Revit <year>\ (the add-in references the per-year RevitAPI.dll / RevitAPIUI.dll)
  • (Optional) NSIS 3.x for building the installer

Build all targets

dotnet build src\UnitsConverter.Core\UnitsConverter.Core.csproj
dotnet build src\UnitsConverter.Revit\UnitsConverter.Revit.csproj -p:RevitVersion=2025 -c Release
dotnet build src\UnitsConverter.Revit\UnitsConverter.Revit.csproj -p:RevitVersion=2026 -c Release
dotnet build src\UnitsConverter.Revit\UnitsConverter.Revit.csproj -p:RevitVersion=2027 -c Release

The output assemblies and .addin manifest land under src\UnitsConverter.Revit\bin\Release\net*-windows\.

Stage the deployment folder

The Stage MSBuild target produces a deployment-ready folder per Revit version at src\UnitsConverter.Revit\dist\<year>\:

dotnet build src\UnitsConverter.Revit\UnitsConverter.Revit.csproj -p:RevitVersion=2025 -t:Stage -c Release
dotnet build src\UnitsConverter.Revit\UnitsConverter.Revit.csproj -p:RevitVersion=2026 -t:Stage -c Release
dotnet build src\UnitsConverter.Revit\UnitsConverter.Revit.csproj -p:RevitVersion=2027 -t:Stage -c Release

Layout:

src\UnitsConverter.Revit\dist\<year>\
├── UnitsConverter.addin              ← ships to %AppData%\Autodesk\Revit\Addins\<year>\
└── UnitsConverter\                   ← ships to %AppData%\Autodesk\Revit\Addins\<year>\UnitsConverter\
    ├── UnitsConverter.dll
    ├── UnitsConverter.Core.dll
    ├── UnitsConverter.deps.json
    ├── UnitsConverter.pdb
    ├── UnitsConverter.Core.pdb
    └── Resources\Images\
        └── *.png, *.ico

Deploy manually

  1. Run the Stage target for each Revit year you want to ship (above).
  2. Copy src\UnitsConverter.Revit\dist\<year>\UnitsConverter.addin into %AppData%\Autodesk\Revit\Addins\<year>\.
  3. Copy the entire src\UnitsConverter.Revit\dist\<year>\UnitsConverter\ folder into %AppData%\Autodesk\Revit\Addins\<year>\.

The end-state on disk matches what the NSIS installer produces:

%AppData%\Autodesk\Revit\Addins\2026\
├── UnitsConverter.addin
└── UnitsConverter\
    ├── UnitsConverter.dll
    ├── UnitsConverter.Core.dll
    ├── UnitsConverter.deps.json
    └── Resources\Images\
        └── *.png, *.ico

The add-in file's <Assembly> tag points at the relative path UnitsConverter\UnitsConverter.dll, which is what keeps the install self-contained inside a single Addins subfolder per Revit year.

Build the installer

pwsh scripts\build-installer.ps1

This runs Stage for every supported Revit year (2025–2027), then compiles Resources\Revit Unit Converter.nsi with NSIS to produce Resources\Revit Unit Conversion Tool Setup.exe. The 2024 component is sourced from the pre-built legacy binaries under Resources/2024/.

Override the defaults with -Years, -Config, -NsisPath, or -NoNsis (see scripts/build-installer.ps1 for details).

Project layout

src/
├── UnitsConverter.Core/            # netstandard2.0 — pure unit catalog (no Revit dep)
└── UnitsConverter.Revit/           # multi-target — Revit add-in
    ├── Addin/                      # ExternalApplication (IExternalApplication)
    ├── Batch/                      # WinForms dialog + BatchRunner
    ├── Commands/                   # IExternalCommand implementations
    ├── Resources/Images/           # ribbon & dialog icons (loaded from disk)
    └── dist/<year>/                # output of `-t:Stage` (gitignored)
scripts/
└── build-installer.ps1             # one-shot stage + NSIS compile
Resources/
├── Revit Unit Converter.nsi        # NSIS installer source
├── 2024/                           # pre-built legacy Revit 2024 binaries
└── License.txt

License

MIT — see Resources/License.txt.

About

Batch convert Revit content between metric and imperial and back again. Compatible with Revit 2022+

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages