A C# command-line utility for processing Autodesk Revit models (.rvt, .rfa) in a headless, UI-less environment.
RevitCoreConsole mimics the Autodesk Revit Design Automation (Forge) environment locally. It loads an AppBundle with an IExternalDBApplication, opens a model, and runs the Design Automation lifecycle without launching the Revit UI — useful for automated pipelines, CI, and local debugging.
Читать на другом языке: Русский
| Project | Path | Role |
|---|---|---|
| RevitCoreConsole | src/RevitCoreConsole/ |
CLI host (System.CommandLine, DI, Serilog) |
| RevitEngine | src/RevitEngine/ |
Revit product host, assembly resolver, AppBundle extraction, Design Automation runtime |
| RevitEngine.DBApplications | src/RevitEngine.DBApplications/ |
.addin parsing and IExternalDBApplication factory |
Also included: build/ (ModularPipelines), samples/ (DB application examples), tests/RevitEngine.UnitTests/.
The repository includes a ModularPipelines build app in the build project. It cleans project bin/obj plus the root bin/, artifacts/, and TestResults/ folders, restores the solution, compiles outputs into bin/<version>/, packages console builds and sample bundles into .zip archives under artifacts/, then optionally runs tests and sample console jobs.
Pipeline stages:
- Clean / Restore
- Build — compile
RevitCoreConsoleand samples intobin/<version>/ - Package — zip
RevitCoreConsoleper Revit version and each sample bundle with every built version inside - Tests — unit tests for each selected Revit version (skipped on GitHub Actions)
- Run — launch
bin/<version>/RevitCoreConsole/RevitCoreConsole.exefor every sample zip inartifacts/(skipped on GitHub Actions; requires a local Revit install). Models are taken frombuild/tests_files/<version>/and copied underbin/<version>/runs/<Sample>/
- .NET SDK (the build project targets
net10.0) - Autodesk Revit installed for each version you want to run locally
- Matching Revit SDK / NuGet packages for the versions you build
- Valid
LicenseKeyandApplicationPathinsrc/RevitCoreConsole/appsettings.<version>.json
Supported and built by default (local pipeline and GitHub Actions): 2018–2027.
From the repository root:
dotnet run --project buildBy default the pipeline builds Revit versions 2018–2027 using the Release configuration.
| Variable | Default | Description |
|---|---|---|
CONFIGURATION |
Release |
MSBuild configuration (Debug, Release, D2025, …). |
REVIT_VERSIONS |
2018,2019,…,2027 |
One or more Revit versions. Separate values with commas, semicolons, or spaces. |
MAX_PARALLELISM |
max(1, ProcessorCount / 4) |
Max parallel work items for version/project fan-out. |
$env:CONFIGURATION = "Release"
$env:REVIT_VERSIONS = "2025,2026"
$env:MAX_PARALLELISM = "2"
dotnet run --project buildCONFIGURATION=Release REVIT_VERSIONS=2025,2026 MAX_PARALLELISM=2 dotnet run --project buildset CONFIGURATION=Release
set REVIT_VERSIONS=2025,2026
set MAX_PARALLELISM=2
dotnet run --project buildbin/
2025/
RevitCoreConsole/
Sample.CsvExport.bundle/
artifacts/
RevitCoreConsole.2024.zip
RevitCoreConsole.2025.zip
Sample.CsvExport.zip
Sample.IfcExport.zip
bin/<version>/— staged binaries for that Revit versionartifacts/RevitCoreConsole.<version>.zip— console package (RevitCoreConsole/…)artifacts/<SampleName>.zip— one sample AppBundle with every built Revit version inside:
Sample.CsvExport.bundle/
PackageContents.xml
2024/
2025/
2026/
2027/
| Option | Alias | Required | Help Name | Default | Description |
|---|---|---|---|---|---|
/input |
/i |
Yes | path/to/model.rvt |
None | Path to a local .rvt / .rfa file, or a remote model path (RSN://…, BIM 360://…). Local files must exist. |
/app-bundle |
/al |
Yes | path/to/bundle.zip |
None | Path to a Design Automation AppBundle .zip (runtime extracts a zip that contains a *.bundle folder). |
/lang |
/l |
No | language_code |
appsettings (English_USA) |
Three-letter Revit language code for the session locale. |
/audit |
/a |
No | — | false |
Audit the document while opening it. |
/worksets |
/w |
No | workset_configuration |
OpenAllWorksets |
Which worksets to open: OpenAllWorksets, CloseAllWorksets, or OpenLastViewed. |
Each run writes a session log to:
logs/RevitCoreConsole-<yyyyMMdd-HHmmss>-<pid>.log
ENU— English (United States)ENG— English (United Kingdom)FRA— FrenchDEU— GermanITA— ItalianJPN— JapaneseKOR— KoreanPLK— PolishESP— SpanishCHS— Chinese (Simplified)CHT— Chinese (Traditional)PTB— Portuguese (Brazil)RUS— Russian (RUis also accepted)CSY— CzechHUN— Hungarian
| Sample | Description | Built by pipeline |
|---|---|---|
Sample.CsvExport |
Export element parameters to CSV | Yes |
Sample.IfcExport |
Export IFC from a 3D view | Yes |
Sample.PurgeUnused |
Purge unused elements | Yes |
Sample.SyncDocument |
Synchronize with central / save | Yes |
Sample.PdfExport |
Export sheets to PDF (Revit 2022+) | No* |
Sample.NwcExport |
Export NWC from a 3D view | No |
*Excluded from the ModularPipelines sample build by solution flags in RevitCoreConsole.slnx.
Each sample ships with PackageContents.xml, a .addin manifest, and optional .json options copied next to the DLL.
Typical layout inside the zip:
MyDbApp.bundle/
PackageContents.xml
2025/
MyDbApp.addin
MyDbApp.dll
MyDbApp.json # optional options
PackageContents.xml maps Revit series (R2018…R2027) to version folders and .addin modules. The .addin must declare Type="DBApplication" with Assembly and FullClassName.
RevitCoreConsole.exe /i "C:\Projects\Models\sample_project.rvt" /al "C:\Projects\Bundles\MyDbAppBundle.zip" /l ENURevitCoreConsole.exe /i "C:\Projects\Models\sample_project.rvt" /al "C:\Projects\Bundles\MyDbAppBundle.zip" /l RUS /aRevitCoreConsole.exe /i "C:\Projects\Models\sample_project.rvt" /al "C:\Projects\Bundles\MyDbAppBundle.zip" /w CloseAllWorksetsLong option names also work: /input, /app-bundle, /lang, /audit, /worksets.
- CLI parse — resolve
/i,/al, optional/l,/a,/w. - Host bootstrap — load
appsettings/appsettings.<RevitVersion>.json, configure DI and logging. - Revit init — resolve Revit assemblies, initialize the product with
LicenseKey. - Bundle load — unzip the AppBundle, read
PackageContents.xml, resolve the.addinfor the current Revit version, create theIExternalDBApplication. - Document open — open the model with audit / workset options.
- Lifecycle —
OnStartup→SetDesignAutomationReady→OnShutdown.
See CONTRIBUTING.md. Credits and third-party acknowledgments: CREDITS.md.
MIT — see LICENSE.md.