RvtIO.Cli
0.2.0
See the version list below for details.
dotnet tool install --global RvtIO.Cli --version 0.2.0
dotnet new tool-manifest
dotnet tool install --local RvtIO.Cli --version 0.2.0
#tool dotnet:?package=RvtIO.Cli&version=0.2.0
nuke :add-package RvtIO.Cli --version 0.2.0
<p align="center"> <img src="docs/images/rvtio-banner.png" alt="RvtIO" width="640"> </p>
RvtIO is a .NET library and command line tool that reads Autodesk Revit projects (.rvt) and families (.rfa) directly from disk, without Revit or the Revit API, and exports IFC and JSON.
What it does
- Reads elements, parameters, geometry, file metadata and project information.
- Queries elements through
FilteredElementCollector. - Exports IFC2X3 coordination view, with optional Revit parameters as property sets.
- Writes compact JSON or a full JSON dump with every parameter and geometry.
Install
Install the command line tool:
dotnet tool install --global RvtIO.Cli
Add the library to a .NET project:
dotnet add package RvtIO
The library targets .NET 8 and .NET 10. It uses managed code without native dependencies or Windows-only APIs and supports Windows, Linux and macOS. Tests currently run on Windows.
Command line
Export a project to IFC:
rvtio project.rvt project.ifc
Export compact JSON:
rvtio project.rvt project.compact.json --compact-json
Export full JSON, including every parameter and geometry:
rvtio project.rvt project.full.json --json-full
Export IFC with Revit parameters as property sets:
rvtio project.rvt project.parameters.ifc --ifc-revit-parameters
A .ifc output path selects IFC. Any other output path selects JSON, which is compact by default. If the output path is omitted, the tool writes output.json. Diagnostics go to standard error.
Export the state of one project phase:
rvtio project.rvt project.ifc --ifc-phase last
rvtio project.rvt project.ifc --ifc-phase 12345
rvtio project.rvt project.ifc --ifc-phase all
An element is left out of the IFC when it is demolished in the export phase or an earlier one, or created in a later one. Without the option the current profile exports the last project phase and the legacy profile every phase; all keeps every element and room, and an id selects that phase (it must occur in the project's phase order, or the tool exits with code 1). Rooms follow the export phase unless --ifc-room-phase names another one. The compact and full JSON are not filtered. In the library the same choices are IfcExporter.ExportPhaseId and IfcExporter.ExportAllPhases.
The Width and Height quantities of the opening of a door or window are those of the door or window as Revit has them: for a door 0.8 wide and 2.1 high the opening gets Width 0.8 (along the wall) and Height 2.1 (vertical), and the Depth is the thickness of the wall, in a wall of any direction. The Width and Height are the instance values, else the type values; a side the door or window holds no value for is measured from the opening, vertical for Height and along the wall for Width. This applies to openings in straight walls; the openings of curved walls and curtain walls, openings that nothing fills and openings of other elements are measured as before. Releases before this one named the sides of the cut loop by the frame they are measured in, which gave the same door Height 0.8 and Width 2.1. To write those values, restore the earlier reading:
rvtio project.rvt project.ifc --ifc-opening-legacy-axes
--ifc-opening-host-axes, the opt-in of the earlier release for the new reading, is still accepted and does nothing. In the library the option is IfcExporter.OpeningQuantitiesSwapped; IfcExporter.OpeningQuantitiesInHostAxes is kept and is the opposite of it.
Use --ifc-revit-parameter-groups for one property set per parameter group. Use --resolve-current-copies for a file saved in several increments: it keeps only the current copy of an element that more than one partition stream holds; without it every copy is decoded as before. Run rvtio --help for all options. Unknown options exit with code 1; options starting with --dev- are not a stable interface.
Exit codes and the export report
| Code | Meaning |
|---|---|
| 0 | The export was written. |
| 1 | The command line is wrong. |
| 2 | The input cannot be read: it is missing, empty, not a compound file, or cut or damaged. One line on standard error, no stack trace. |
| 3 | A stream exceeded a limit of the reader and the read was cut. Nothing is exported unless --allow-partial is given. |
| 4 | The file is readable but a decoder failed on its content. |
--report project.report.json writes a machine-readable report: the fraction of each partition stream and of the element table that decoded, the streams cut by a limit, the elements the export left out with their class and reason, and the exported fraction. --raise-limits raises the limits for a very large model. A complete export without these options behaves as before. The report format and the limits are described in the export report.
Library
Open a project, list wall instances through FilteredElementCollector, and export the document to IFC:
using System;
using RvtIO;
using RvtIO.BuiltIns;
using RvtIO.Ifc;
var doc = RvtDocument.Open("project.rvt");
FilteredElementCollector walls = doc.Collector()
.OfCategory(BuiltInCategory.OST_Walls)
.WhereElementIsNotElementType();
foreach (var wall in walls)
{
Console.WriteLine($"{wall.Id}: {wall.Name}");
}
new IfcExporter().Export(doc.RawData, "project.ifc");
The library is silent by default. Set RvtReaderOptions.DiagnosticOutput for reading or IfcExporter.DiagnosticOutput for export to receive diagnostics through a TextWriter.
See the public API for the supported surface and dependencies for package details.
Examples
IFC exports of sample models opened in an IFC viewer:
| Revit 2022 sample project | Revit 2025 sample project exported to IFC |
|---|---|
Supported files
Reads .rvt projects and .rfa families. Testing covers sample projects saved by Revit 2020, 2021, 2022, 2023, 2024, 2025 and 2026. Revit 2027 files open with partial support.
The tested projects include basic and advanced architecture, structure and MEP samples, plus several larger multi-discipline models.
Limitations
- Version 0.2.0 is a preview. The API can change before 1.0.
- Geometry coverage is partial for some element kinds.
- Revit 2027 support is partial.
- There is no support for writing or modifying Revit files.
- IFC output is limited to IFC2X3 coordination view.
- Output was compared with an independent reference exporter on the tested samples. Byte equality with Revit's own IFC export is not claimed.
Build from source and tests
Use the .NET SDK selected by global.json, which specifies 10.0.100 with latestFeature roll-forward.
From the repository root:
dotnet build RvtIO.slnx -c Release
dotnet test
Tests requiring real Revit files are skipped with a message unless RVTIO_TEST_FILES points to a folder containing the private fixtures. The repository includes no Revit models.
Optional test variables are RVTIO_REVIT_RESOURCES, for a copy of Revit resource DLLs used to re-verify the built-in name tables, and RVTIO_NATIVE_TABLE_DIR.
Contributing
See CONTRIBUTING.md and the Code of Conduct. Release changes are recorded in CHANGELOG.md.
Security
Report vulnerabilities through GitHub private vulnerability reporting in the repository's Security tab. Do not open public issues for security vulnerabilities. See SECURITY.md.
License and trademarks
RvtIO is licensed under the MIT License. Copyright holder: mahach666.
RvtIO is not affiliated with, endorsed by or sponsored by Autodesk. Autodesk and Revit are trademarks of Autodesk, Inc.
The file format is read by analysing files for interoperability. No Autodesk code or binaries are included.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.