Repository navigation
fix(ifc)!: on Revit 2027 saves, write a flight type whose flights are all sketched runs USERDEFINED, as Revit 27.3 does (#2110) (RE-217) - #2302
Merged
Conversation
…EFINED as USERDEFINED with NOTDEFINED as its ElementType, as Revit 27.3's export does (#2110)
… which match Revit's on every scored model; docs and changelog (#2110)
…-out exporter version as inferred, and states the pre-27.3 limit
…pes whose flights are all sketched runs, read from each run's cell (RE-217 §14)
… type, the NOTDEFINED ones type floors and ladders); RE-217 §14 counts 174 straight flights and gives its reproduce command
…s IFC4 enumeration has no member for it
…, and says the NOTDEFINED stair types include floors and ladders
…arry their type since #2297
DrunkOnJava
marked this pull request as ready for review
December 6, 2026 12:19
… code that builds one by struct literal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a Revit 2027 save, a stair flight type that rvt-rs would write
NOTDEFINEDis writtenUSERDEFINED, withNOTDEFINEDas itsElementType, where every flight it types is a sketched run. That's what Revit's exporter from 27.3 writes for a flight whose run style it can't name. Earlier exporters wroteNOTDEFINED, and rvt-rs keeps doing so on earlier releases.A run's style is the class of the one run cell its native
StairsRunrecord holds (RE-217 §14). On the 15 models with a Revit export that hold stairs, it matches Revit's flight type by Tag on every flight:STRAIGHT(174);SPIRAL(5);NOTDEFINED(4: the BIM4LCA timber office's two runs, as built and at permit).rvt-rs reads a run's style only as straight or spiral. So a winder run, which revit-ifc names
WINDER, would also beNOTDEFINEDin rvt-rs, and so would a run whose record isn't read. The step leaves both out: it applies only to a type all of whose flights hold a sketched cell.Motivation
#2110, from a reporter's Revit 2027 model: three exports of it by Revit 27.3 and 27.4 write no
NOTDEFINEDflight type, and the 9 flights whose types rvt-rs writesNOTDEFINEDare the 9 Revit writesUSERDEFINED. revit-ifc'sIFCExportInfoPairpredefined-type setter turns a value assigned asNOTDEFINEDintoUSERDEFINEDfrom the tagIFC_v27.3.0.12, andStairsExporter.GetValidatedStairFlightTypenames a flight by its run's style, parsed into the IFC4 enumeration, which has no member for a sketched run, so it isNOTDEFINED(read atIFC_v19.2.0andIFC_v27.3.0.12).Changes
src/research/native_stairs.rs:native_run_readsreturns the runs whose graph holds oneStairsSketchedRunCell, read in the sameStairsRunpass as the run shapes (native_run_shapeskeeps its signature).src/research/partition_schema_mvp/stair_bodies.rs,fields.rs: a sketched run carriesSTAIR_RUN_SKETCHED_FIELD.src/ifc/export_content.rs,src/ifc/mod.rs,src/ifc/from_decoded.rs:IfcModel::sketched_runs, the ElementIds of those runs.src/ifc/category_map.rs:UNNAMED_FLIGHT_TYPE_USERDEFINED_FROM(2027) and the classes it applies to, with the evidence and limits.src/ifc/step_writer.rs: after the type objects are grouped, aNOTDEFINEDflight type on a 2027 save whose flights are all insketched_runsis writtenUSERDEFINEDwithElementType'NOTDEFINED'. A type with any other flight staysNOTDEFINED.probes/examples/probe_2110_run_types.rs,tools/re/run_cells_vs_ifc.py: each run's cell class, and its pairing with Revit's flight type by Tag.reports/element-framing/RE-217-stair-runs-2025.md§14,docs/status.md,changelog.d/changed/2027-flight-types-userdefined.md.IfcModelliteral gain the new field. No unit tests.Testing
main, unfiltered with the samples, the BIM4LCA models and the Revit 2025 set (run 47639862454 on9ce96840). Registered before the run: exactly one export moves,rac_basic's 2027 save. Result: 100 of 101 exports identical, all 101 diagnostics identical, no scorer differences, and the one export differs by the one lineIfcStairFlightTypeTag 141730.NOTDEFINED.→.USERDEFINED.withElementType'NOTDEFINED', its GlobalId unchanged. The same-project gates pass. Since thenmain(with fix(elements): read Precast stair types and stair types with a project-parameter entry (#2297) (RE-65) #2300) has been merged in and only docs and comments changed; the head,b7470942, gives the same (run 47645032411: 100 of 101 exports and all diagnostics identical, no scorer differences, gates pass).rac_basic's run 665560, on each save), and no winder cell; across every model it reads none.rac_basic's 2027 save, and no Revit export of that model checks it. The sketched style rests on one building with a Revit export (24.0.5), and the reporter's runs' cells aren't read, so this doesn't claim to fix all nine of theirs.Breaking changes
IfcModelgains a public field,sketched_runs, which cargo-semver-checks counts as breaking (constructible_struct_adds_field): code that builds anIfcModelwith a struct literal naming every field adds it, or uses..Default::default(). Announced with!in the title, as #2284 did forframing_members, and in the changelog entry. Output changes only on Revit 2027 saves, as above.Clean-room declaration
The changes in this PR are based on public byte observations of the BIM4LCA and Autodesk sample files, checked against Revit's own IFC exports of the BIM4LCA and Revit 2025 models; the reporter's counts on #2110 and #2046; and Autodesk's open-source exporter revit-ifc, read for what Revit's export writes (
IFCExportInfoPair.cs,StairsExporter.cs,Toolkit/IFC4Enums.cs, cited and not copied). I have not used Autodesk SDK source, ODA SDK source, leaked internal documentation, NDA material, or decompiled internal Revit implementation code beyond public symbol exports, and I have not copied or translated code from revit-ifc.Refs #2110