Repository navigation
feat(ifc): a stair flight takes the predefined type its treads give, STRAIGHT or SPIRAL (#323) - #962
Merged
Merged
Conversation
DrunkOnJava
enabled auto-merge (squash)
October 25, 2026 06:34
This was referenced Oct 25, 2026
Roofs Revit's export decomposes into IfcSlab .ROOF. parts (7 of Snowdon's 20) are written whole
#323
Open
DrunkOnJava
added a commit
that referenced
this pull request
Oct 25, 2026
…pes and families from their native records (#323) (#974) ## Summary Revit 2025 stairs, flights and stringers are now named and typed as Revit's export names them, from their native records. On puzzbobb's five R2025 stair models every stair, flight and stringer has Revit's `Name` and `ObjectType` and a type object with Revit's GlobalId, where none had a name or a type. Part of #323 (RE-65 §6). ## Motivation RE-65 names stairs `Family:Stair:ElementId` and their parts `<stair> Run 1` from type flags at byte offsets measured on Revit 2024 (`partition_stairs`), which are absent on 2025. The 2025 native records hold the same facts by member name, which RE-217 already reads for the runs' geometry. ## Changes - `src/native_stairs.rs`: `native_stair_parts` reads `StairsElement.m_typeId` → `StairsType` (`m_constructionMethod` 0 `Assembled Stair`, 1 `Cast-In-Place Stair`; left/right support type ids and styles), `StairsRun.m_stairsId` with its own run type (RE-28, as `native_runs`) and that type's `m_hasMonolithicSupport` (`Monolithic Run` / `Non-Monolithic Run`), `StairsSupport.m_hostCompId` and `m_typeId` (`Stringer` where every side of the stair type using that type has support style 1), and each type's `SymbolInfo.m_name`. `NATIVE_STAIR_NAME_REVIT_VERSIONS = [2025]`; anything else fails closed. - `src/partition_schema_mvp.rs`: `attach_native_stair_names`, after RE-65's 2024 pass: type id, type name, family and element name, a part numbered in ElementId order among its stair's exported parts of its kind. A run the body pass already gave its type keeps it and gains its family and name. - `examples/probe_323_stair_names_2025.rs`, `tools/re/stair_names_list.py` (Revit's names beside the native records). - `reports/element-framing/RE-65-stair-names.md` §6, `docs/status.md`, `docs/support-matrix.json`, `README.md` (names row), `changelog.d/added/stair-names-2025.md`. ## Testing Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead. - [ ] `tools/check-local.sh`: CI. - [x] Verified end to end on real Revit files. Measure [40179287273](https://github.com/DrunkOnJava/rvt-rs/actions/runs/40179287273), this change against `main`, `-f r2025=true -f nordic=true`, `names_vs_ifc` and `type_objects_vs_ifc`: | R2025 model (Apache-2.0) | stair parts with Revit's Name and ObjectType | elements typed as Revit types them | type objects with Revit's GlobalId | |---|---|---|---| | 13, 14, 15 (Assembled) | 0 → 4 of 4 each | 21 → 25 of 25 each | 17 of 21 → 21 of 25 each | | 16, 17 (Cast-In-Place) | 0 → 2 of 2 each | 21 → 23 of 23 each | 17 of 21 → 19 of 23 each | The flight type objects carry #962's `STRAIGHT` / `SPIRAL`, as Revit's do. No other model's names or types change; that run's office door-size difference is #972, which the branch predated (now rebased). - [x] The rule also holds on the BIM4LCA office (Revit 2024, Measure [40178166596](https://github.com/DrunkOnJava/rvt-rs/actions/runs/40178166596)): construction 1 on its 13 Cast-In-Place stairs and 0 on its Assembled one, every type name Revit's. RE-65's byte path keeps naming 2024 files. - Not measured: landings and precast stairs on 2025 (no oracle has them); they stay unnamed. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [x] A user-visible change has its entry as a fragment under `changelog.d/` - [x] Resolved limitation updated (support matrix, status) - [x] Limitation documented: 2025 landings, precast stairs and other support styles (RE-65 §6) - [x] Commit messages describe what changed and why - [x] No emojis in code, docs, or commit messages - [x] No private paths, personal email addresses, or internal jargon in committed files - [x] Finding recorded as RE-65's addendum ## Legal and contribution hygiene - [x] Apache-2.0 - [x] No Autodesk proprietary content. Clean-room declaration: the members are read from the files' own schema (`Formats/Latest`) by `native_document`; no Autodesk SDK source, disassembly or NDA material was used. - [x] No fixtures ## Breaking changes None. `native_stair_parts`, `NativeStairPart` and `NATIVE_STAIR_NAME_REVIT_VERSIONS` are new, in the research surface. ## Related issues Refs #323
DrunkOnJava
added a commit
that referenced
this pull request
Oct 25, 2026
…ve, as Revit's export decides it (#323) (#968) ## Summary A stair's `PredefinedType` is now the one Revit's export gives it from its runs and landings, where every stair was `.NOTDEFINED.` or unset: `SPIRAL_STAIR`, `STRAIGHT_RUN_STAIR`, `TWO_STRAIGHT_RUN_STAIR`, `QUARTER_TURN_STAIR`, `HALF_TURN_STAIR`, `DOUBLE_RETURN_STAIR` or `THREE_QUARTER_TURN_STAIR`. On the BIM4LCA office all 16 stairs of each file have Revit's value, where 2 did, and so do the 5 R2025 stair models. Part of #323. ## Motivation #323 is stairs and their parts as Revit exports them. After #962 typed the flights, the stairs themselves were the remaining `PredefinedType` gap: Revit's export of the office writes 10 `DOUBLE_RETURN_STAIR`, 2 `STRAIGHT_RUN_STAIR`, 1 `HALF_TURN_STAIR`, 1 `SPIRAL_STAIR` and 2 `NOTDEFINED`. ## Changes - `src/native_stairs.rs`: `RunShape` carries each run's `m_runType` and its climb direction (its first tread's `m_runDirProj`); `stair_predefined_type` applies revit-ifc's `StairsExporter.GetValidatedStairType` rule (CLEANROOM.md source 5) to a stair's runs in ElementId order and its landing count. Three runs each square to the one before with two landings are always `DOUBLE_RETURN_STAIR`: revit-ifc's flight-path start test holds on all ten office stairs of that layout although their runs' `m_bottomElevation`s differ, and a first rule comparing those wrote all ten `TWO_QUARTER_TURN_STAIR`. - `src/partition_schema_mvp.rs`: `attach_stair_run_shapes` groups runs and landings by the stair they aggregate into and sets `STAIR_TYPE_FIELD` on the stair. - `src/ifc/export_content.rs`: an `IfcStair` takes it after a predefined type its own export parameters set (RE-45). - `reports/element-framing/RE-217-stair-runs-2025.md` §12, `docs/status.md`, `docs/support-matrix.json` (`element-records-stair-aggregates`, whose note said a stair's own type was not read), `changelog.d/added/stair-predefined-types.md` (and the flights fragment's "not read yet" sentence dropped). ## Testing Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead. - [ ] `tools/check-local.sh`: CI. - [x] Verified end to end on real Revit files. Measure [40175841982](https://github.com/DrunkOnJava/rvt-rs/actions/runs/40175841982), this change against `main` (51287f2), default models plus `-f nordic=true -f r2025=true`, `predefined_types_vs_ifc` and `type_objects_vs_ifc`: | model | stairs with Revit's PredefinedType | |---|---| | BIM4LCA office as built (CC BY-SA 4.0) | 2 → 16 of 16 | | BIM4LCA office at building permit | 2 → 16 of 16 | | R2025 stair models 13 to 16 (Apache-2.0) | 0 → 4 of 4 (`STRAIGHT_RUN_STAIR`) | | R2025 model 17 | 0 → 1 of 1 (`SPIRAL_STAIR`) | Revit keys a type's second and later type objects by entity and predefined type (B73), so with each stair's value ten more office stair type objects take Revit's GlobalId (12,029 → 12,039 of 12,358 on the as-built file). Only these seven models' IFC changes, and no other scorer's output. - [x] Re-measured after the Codex fix (stairs typed after `attach_stair_names` resolves shared parts): Measure [40177777679](https://github.com/DrunkOnJava/rvt-rs/actions/runs/40177777679) against `main` (9afafa7), the same counts and the same scorers changed. - [x] Witness: Core Interior's export is unchanged (it has no stair runs). - Not re-measured: Snowdon Towers (local only). ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [x] A user-visible change has its entry as a fragment under `changelog.d/` - [x] Resolved limitation updated (support matrix, status) - [x] Limitation documented: stairs with winders or sketched runs, and layouts the rule does not name, keep `.NOTDEFINED.` (RE-217 §12) - [x] Commit messages describe what changed and why - [x] No emojis in code, docs, or commit messages - [x] No private paths, personal email addresses, or internal jargon in committed files - [x] Finding recorded as RE-217's addendum ## Legal and contribution hygiene - [x] Apache-2.0 - [x] No Autodesk proprietary content. Clean-room declaration: `m_runType` and `m_runDirProj` are read from the file's own schema (`Formats/Latest`) by `native_document`; the layout rule is from revit-ifc, the open-source LGPL exporter CLEANROOM.md lists as source 5, read for behaviour, not copied. No Autodesk SDK source, disassembly or NDA material was used. - [x] No fixtures ## Breaking changes None. `RunShape` and `native_run_shapes` changed shape inside the research surface (unstable-research); `stair_predefined_type`, `STAIR_TYPES` and `STAIR_TYPE_FIELD` are new there. ## Screenshots or output samples ``` IfcStair: 16 in both; same 16, differs 0, unset in rvt-rs 0; Revit's: {'DOUBLE_RETURN_STAIR': 10, 'HALF_TURN_STAIR': 1, 'NOTDEFINED': 2, 'SPIRAL_STAIR': 1, 'STRAIGHT_RUN_STAIR': 2} ``` ## Related issues Refs #323
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
A stair flight's
PredefinedTypeis nowSTRAIGHTorSPIRAL, from them_runTypeits treads' native records carry, where every flight was.NOTDEFINED.or unset. On the BIM4LCA office all 35 flights of each file have Revit's value, and so do the 5 R2025 stair models' flights. Part of #323.Motivation
#323 is stairs and their parts as Revit exports them. Revit's export types each flight by its shape. RE-217 found
StairsTreadInfo.m_runType, 0 on every straight run and 2 on both spiral runs, and Revit's export writes.STRAIGHT.and.SPIRAL.for exactly those.Changes
src/native_stairs.rs:native_run_shapesreads the onem_runTypea run's treads all give, on Revit 2024 and 2025 (NATIVE_RUN_SHAPE_REVIT_VERSIONS).flight_predefined_typenames the two values measured; any other value names nothing.src/partition_schema_mvp.rs:attach_stair_run_shapes, fieldSTAIR_RUN_SHAPE_FIELD.src/ifc/export_content.rs: anIfcStairFlighttakes it after a predefined type its own export parameters set (RE-45); the flight's type object follows.tools/re/predefined_types_vs_ifc.py, in Measure's default scorers:PredefinedTypeof stairs, flights, slabs and members paired by Tag, and the flight type objects' values.reports/element-framing/RE-217-stair-runs-2025.md§10,docs/status.md,docs/support-matrix.json(element-records-stair-aggregates, whose note said PredefinedTypes were unset),changelog.d/added/flight-predefined-types.md.Testing
Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead.
tools/check-local.sh: CI.Verified end to end on real Revit files. Measure 40168694898, this change against
main(eb369d9), default models plus-f nordic=true -f r2025=true,predefined_types_vs_ifc:STRAIGHT, 1SPIRAL)NOTDEFINED×2 →STRAIGHTandSPIRAL, Revit'sSTRAIGHT, 1SPIRAL)Only these seven models' IFC changes, and no other scorer's output or diagnostics. Decode time is flat (office 29.2 s on both sides, same CPU).
Witness: Core Interior's export is unchanged (it has no stair runs).
Not re-measured: Snowdon Towers (local only).
Audit-honesty checklist
changelog.d/DOUBLE_RETURN_STAIRand the like) is not read (RE-217 §10, support matrix)Legal and contribution hygiene
m_runTypeis read from the file's own schema (Formats/Latest) bynative_document; no Autodesk SDK source, disassembly or NDA material was used.Breaking changes
None.
native_run_shapes,flight_predefined_typeandSTAIR_RUN_SHAPE_FIELDare new, in the research surface.Screenshots or output samples
Related issues
Refs #323