Expand description
§rvt-rs · open reader for Autodesk Revit files
Reads .rvt, .rfa, .rte and .rft files without Revit or any
Autodesk component: metadata, previews and the embedded schema of every
release from 2016 to 2026, and, on Revit 2024 and 2025 project files, the
building itself (typed elements with Revit’s ElementIds, names, types,
storeys, materials, layers, GlobalIds and some type parameters), written
out as IFC4, glTF or plan SVG.
What it recovers is measured against Revit’s own IFC export of the same
file, model by model; it is a reader, not a converter for every model.
docs/supported-profile.md and docs/support-matrix.json in the
repository say exactly what is read on which input, and every export
comes with diagnostics naming what was approximated or left out.
§Read a file’s identity
use rvt::RevitFile;
let mut rf = RevitFile::open("model.rvt")?;
let summary = rf.summarize()?;
println!("Revit {} ({})", summary.version, summary.build.as_deref().unwrap_or("—"));§List the elements of a Revit 2024 or 2025 project
use rvt::RevitFile;
use rvt::ifc::RvtDocExporter;
use rvt::ifc::entities::IfcEntity;
let mut rf = RevitFile::open("project.rvt")?;
let result = RvtDocExporter.export_with_diagnostics(&mut rf)?;
for entity in &result.model.entities {
if let IfcEntity::BuildingElement { ifc_type, name, type_guid, .. } = entity {
// `type_guid` carries the Revit ElementId (the IFC Tag).
println!("{ifc_type} {name} {}", type_guid.as_deref().unwrap_or("-"));
}
}
// What was approximated or left out, as the CLI's --diagnostics writes it.
println!("{}", serde_json::to_string_pretty(&result.diagnostics).unwrap());§Write IFC4 and glTF
use rvt::RevitFile;
use rvt::ifc::{Exporter, RvtDocExporter, gltf::model_to_glb, write_step};
let mut rf = RevitFile::open("project.rvt")?;
let model = RvtDocExporter.export(&mut rf)?;
std::fs::write("project.ifc", write_step(&model))?;
std::fs::write("project.glb", model_to_glb(&model))?;§Format overview
- Container: Microsoft Compound File Binary Format 3.0 (
[MS-CFB]) - Compression: truncated-gzip, a 10-byte gzip header followed by raw
DEFLATE, and, for the database streams and
Formats/Latest, stored in checksum pages that are stripped before inflating (compression::inflate_stream_at). - Schema:
Formats/Latestdeclares every serialized class and its fields (formats::parse_schema). - Elements:
Global/ElemTabledeclares the ElementIds; each element’s record in thePartitions/*streams carries its category, class, bounding box and references (partition_element_records).
§Module overview
reader—RevitFile, the main entry pointbasic_file_info— version, GUID, build tag, creator path, worksharing text blockmetadata—metadata::FileMetadata: document identity, readable without loading the whole filepart_atom— Atom XML with OmniClass + taxonomiesproject_information— project-fileProjectInformationZIP → Atom entryformats— class schema with tags, parents, field typesobject_graph— document history, string-record extractionelem_table—Global/ElemTableparserpartitions—Partitions/NNheader + chunk splitterpartition_scanner— version-gated generic partition record candidatescompression— truncated-gzip decodeclass_index— fast class-name inventorycorpus— cross-version delta analysisidentity— document-scoped ElementId / UniqueId contracts (Phase 1)evidence— evidence tiers + research edge ledgers (Phase 1)es_refs— ES reference occurrence locator contracts (Phase 1; no decoder)relations— experimental relation-domain registry + SCC/quarantine stubscapability— honest capability manifest snapshot for doctor/CLItransmission_data— TransmissionData UTF-16LE detect + opportunistic XML/UUID/path extractcompound_framing— compound ArcWall0x0821marker tokenization (research; no opening decode)writer— byte-preserving OLE round-tripredact— shared PII scrubbers for all CLIscli— behaviour shared by the shipped CLIs (quiet exit on a closed pipe)ifc— IFC4 / glTF / plan SVG / CSV export and diagnosticserror—Error+Resultaliasesstreams— named constants for every invariant OLE stream
§Safety
This crate is read-only for the OLE container and performs no
privileged operations. Files are opened via the cfb crate with
standard POSIX read semantics. The writer::copy_file function
writes a new file at a caller-specified path.
All decompression uses flate2 in safe Rust (miniz_oxide backend
by default, no C toolchain required). No unsafe blocks in the
public surface.
§License
Apache-2.0. See LICENSE. Not affiliated with Autodesk. “Revit” and related marks are trademarks of Autodesk, Inc.
rvt-rs is intended as a clean-room interoperability implementation. It does not use Autodesk/ODA SDK sources, leaked documentation, or decompiled proprietary implementation code — see CLEANROOM.md for the formal policy on accepted / forbidden sources. Users with specific legal constraints should evaluate the project with their own counsel. Nothing in this crate’s documentation is legal advice.
Re-exports§
Modules§
- arc_
wall_ record - Raw-byte decoder for ArcWall (tag 0x0191) partition records.
- basic_
file_ info - Parse the
BasicFileInfoOLE stream — UTF-16LE metadata every Revit file carries. - capability
- Honest capability manifest snapshot (Phase 1 leftovers).
- class_
index - Extract the class/schema inventory from the
Formats/Lateststream. - class_
tag_ map - Cross-version class-tag lookup (L5B-10).
- cli
- Behaviour shared by the shipped command-line tools.
- compound_
framing - Compound ArcWall (
0x0821) stamp / marker investigation harness. - compression
- Truncated-gzip decompression for Revit streams.
- control
- Cooperative cancellation and progress reporting for long scans.
- corpus
- Phase B · Corpus-wide delta inference engine.
- elem_
table Global/ElemTable— Revit’s element-id index.- element_
record_ beam_ cuts - Beam bodies on Revit 2023: a beam stops at the face of the column its record names (RE-122).
- element_
record_ column_ cuts - Column bodies: the record box is the whole prism, the joined walls cut it.
- element_
record_ level_ refs - Level ElementId binding from a partition element record’s counted reference list (#219, RE-27).
- element_
record_ plan_ profiles - Plan profiles for sketched elements, from
OST_SketchLinespartition element records (#31, RE-25). - element_
record_ storeys - Storey elevations recovered from partition element-record bboxes.
- element_
record_ wall_ joins - Wall bodies: the record box is the untrimmed wall, the joins cut it.
- elements
- Per-class element decoders.
- error
- es_refs
- ES reference occurrence locator contracts (Phase 1).
- evidence
- Named evidence tiers and lightweight ledgers (Phase 1).
- formats
- Parse
Formats/Latestinto a real schema table. - geometry
- Geometry primitives and Lane Six recovery helpers.
- identity
- Document-scoped identity and source-span contracts (Phase 1).
- ifc
- Layer 5 — IFC export (document-level scaffold).
- level_
bind - Fail-closed Level ElementId → building-storey index binding.
- metadata
- Document identity at a glance — the answer to “what is this file?”.
- object_
graph - Phase D v0 · Object graph deserializer — starter pieces.
- parse_
mode - Strict vs lossy parse modes + diagnostics.
- part_
atom - Parse the
PartAtomOLE stream — plain Atom-format XML that Autodesk uses to carry family metadata (title, category, taxonomy, links). - partition_
arc_ walls - Shared partition ArcWall iteration (RE-15 / D20).
- partition_
beam_ axes - Beam location lines from their serialised element data (RE-49).
- partition_
compound_ structure - Host types’ layers and which side of a wall is its exterior (RE-53).
- partition_
design_ options - Design option sets and their primary options (#319, RE-40).
- partition_
element_ records - Partition element-record headers: ElementId + BuiltInCategory + bbox.
- partition_
element_ records_ 2023 - Revit 2023 partition element records (RE-81, #421).
- partition_
id_ objects - Serialised objects keyed by their ElementId, found in one pass.
- partition_
ifc_ export_ overrides - Per-element IFC export-type overrides carried in the Revit 2024 partition parameter blocks (#212, RE-22).
- partition_
instance_ transforms - A family instance’s transform, from its own element data (RE-87).
- partition_
level_ records - Revit
Levelelements recovered from the partition streams (#218, RE-24). - partition_
materials - Material shading colours and transparency (RE-53).
- partition_
name_ candidates - Partition UTF-16LE display-name candidates (RE-15 / #86).
- partition_
names - Family and type names from partition name entries (RE-38).
- partition_
roof_ slopes - Roof edges’ slopes (RE-56).
- partition_
room_ boundaries - Room plan outlines from the faces of each room’s stored solid (RE-101).
- partition_
room_ parameters - Room number / name / host Level from the Revit 2024 partition parameter block a room owns (#90, RE-29).
- partition_
scanner - Generic partition-stream record scanner (M3-03 / M3-04).
- partition_
schema_ mvp - Schema / partition MVP recovers for production
iter_elements. - partition_
stairs - Stair and stair-run dimensions from their serialised element data (RE-47).
- partition_
type_ materials - The materials a family type’s geometry uses (#355, RE-82).
- partition_
type_ parameters - Text parameters of element types, stored under their BuiltInParameter (#35, RE-77).
- partition_
type_ records - Revit type records recovered from the partition streams (#88, RE-28).
- partitions
- Partitions/NN stream — Revit’s bulk BIM content.
- project_
information - Parse the
ProjectInformationOLE stream — project files only. - reader
- High-level reader API. Opens a
.rvt/.rfa/.rte/.rftfile and exposes its streams + parsed metadata. - rect_
opening_ index - Version-gated decoder for Revit 2024 ArcWallRectOpening 60 B index records (RE-15-09).
- redact
- Shared redaction helpers — strip PII from free-form strings while preserving surrounding structure so the shape of a finding remains verifiable. Used by every CLI that surfaces user-authored paths or Autodesk-internal identifiers.
- relations
- Experimental typed-relation domains, SCC condensation, and quarantine.
- revit_
global_ ids - The IFC
GlobalIdRevit’s own exporter gives an element, rebuilt from the file (RE-48). - round_
trip - Round-trip verification harness (WRT-04).
- streams
- Known OLE stream names in Revit files.
- transmission_
data TransmissionDatastream — encoding detection + opportunistic extracts.- walker
- Layer 5a walker — schema-directed instance reader for ADocument.
- wasm
- WASM bindings (VW1-01) — JS-callable wrappers around the viewer API.
- writer
- Write path — round-trip Revit files + stream-level patching.