Skip to content

fix(ifc)!: a Revit 2027 save is written without a PredefinedType on ten classes, as Revit's own export writes none (#1692) (RE-427) - #1714

Merged
DrunkOnJava merged 6 commits into
mainfrom
research/1692-predefined-types
Nov 11, 2026
Merged

DrunkOnJava merged 6 commits into
mainfrom
research/1692-predefined-types

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

A Revit 2027 save is now written without a PredefinedType on the occurrence of ten classes: stairs, stair flights, slabs, members, furniture, doors, windows, walls, railings and roofs. Revit's own export of the two held-out pairs saved by 2027 writes none on 71 elements of those classes, where its export of the same projects saved by 2024 to 2026 writes one. It still writes one on the building element proxies, the opening elements, the spaces and every type object, and rvt-rs writes those as before. The scorer behind this reads every class that has a PredefinedType now, not eight.

Motivation

#1692 found rvt-rs writing a PredefinedType where Revit's 2027 export writes none (7 elements of the two held-out 2027 pairs, on four classes the scorer then read). The scorer was widened first, as the issue asked, to every class that declares one, every element type class and every space. Measure 43010340133 (held-out pairs only, counts), main at 5cf94975:

Revit 2027 export, two held-out pairs elements PredefinedType
stairs, stair flights, slabs, members, furniture, doors, windows, walls, railings, roofs 71 none on every one
building element proxies 88 NOTDEFINED on every one
opening elements 29 OPENING on every one
spaces 8 NOTDEFINED on every one
type objects (door, window, slab, stair, flight, member, wall, railing, furniture, proxy) their enumerators, equal to rvt-rs's on every class but slabs and roofs (Revit types the roof by an IfcSlabType ROOF, as it does from 2025)

The same classes in the 2022, 2024, 2025 and 2026 pairs hold a value in Revit's export, and on every class of those pairs rvt-rs writes none where Revit writes NOTDEFINED or an enumerator only where it writes none itself (differs 0 and NOTDEFINED where Revit writes none 0; the elements rvt-rs leaves unset are #1713). So the difference is the 2027 exporter's, as #1472 found for ObjectType, and by the standing rule a value one of Revit's exports omits is left out. A 2027 save can only be exported by Revit 2027 or later, so for these ten classes the leave-out is certain; the classes the two pairs do not hold (columns, beams, coverings, curtain walls, plates, footings, ramps, shading devices, the MEP terminals) are not measured on 2027 and keep their value.

Why: Autodesk's public exporter source (revit-ifc, IFCInstanceExporter.cs, tag IFC_v27.4.0.30; cited, not quoted) writes an occurrence's PredefinedType only where the element has no type object when it is created, and the creators of walls, slabs, railings, roofs, stairs, flights, members, doors and windows call that helper while those of proxies, openings and spaces do not. The helper is in none of v24.3.40, v25.4.40, v26.4.1, v27.0.1 and v27.0.1.1 and first appears in v27.3.0.12, so the exporter's build decides and not the save's release: a Revit 2027 install with an older exporter still writes the values, and the file does not say which read it (the caveat of #1472).

Changes

  • src/ifc/category_map.rs: predefined_type_left_out(ifc_type, revit_version), with PREDEFINED_TYPE_LEFT_OUT_FROM (2027) and PREDEFINED_TYPE_LEFT_OUT_CLASSES (the ten entities). The occurrence's PredefinedType is $ in src/ifc/step_writer.rs where it is true. The type objects, their GlobalIds and the property sets that depend on a predefined type take the element's value as before, so none of them moves.
  • src/ifc/scene_graph.rs (the viewer's element panel), src/ifc/schedule_csv.rs and rvt-mcp/src/views.rs report the PredefinedType the export writes, so they agree with it: the first run of the change failed the MCP consistency check without this (31 and 24 elements of the two pairs differed).
  • tools/ci/ifc_schema_arity.py: the release is read from the project's Revit <release> export description, and the ten classes are not required to carry a PredefinedType from 2027 (the first run failed this check on the five 2027 samples).
  • tools/re/predefined_types_vs_ifc.py: reads every IfcElement class that declares a PredefinedType (paired by Tag), counts the elements one file holds and the other does not, tallies every IfcElementType class and every product that is no element and declares one (spaces, ports), and opens each file once. tools/ci/scrub-holdout-results.sh keeps those lines as counts beside IFC class names.
  • docs/status.md, changelog.d/changed/1692-no-predefined-type-from-2027.md; the report reports/element-framing/RE-427-revit-2027-predefined-type.md and the criteria page.

Testing

Unit tests are banned in this repository: no tests added. Verified end to end on real files:

  • full / CI passed on the final head
  • Unfiltered Measure of the final measured head 5d3cccc1 against main 5cf94975, every flag, keep_ifc (43017489469, kept under refs/archive/2026-11-11/cited/5d3cccc1b477; the later commit adds the report, the criteria entry and the addendum):
    • 119 of 126 exports are byte-identical; the 7 that move are 2027 files: the two held-out 2027 pairs and Autodesk's 2027 saves of rac_advanced, rac_basic, rme_advanced, rme_basic and rst_basic. On the five samples no entity is added or removed and the only attributes that change are PredefinedType (an enumerator to $) on doors, members, slabs, stairs, flights, walls and windows, plus the export time: 7,386 values, 6,320 of them curtain wall mullions.
    • The 2027 pairs read differs 0 on the ten classes (71 elements: before, 36 differs, 19 NOTDEFINED where Revit writes none, 16 same); the proxies' unset and the spaces are as on main (PredefinedType: Revit's export writes one that rvt-rs leaves none or NOTDEFINED on, on walls, railings, ramps, roofs, proxies, light fixtures, pipe segments and stairs (42 models with a Revit export) #1713).
    • psets_vs_ifc, qtos_vs_ifc, global_ids_vs_ifc, names_vs_ifc, the schema findings and the MCP consistency check (90 and 77 compared, 0 differ) are unchanged on all 126 models; same-project gates pass on the head.
    • The first run (43012719379, head 257adfc2) failed the MCP consistency check and the schema arity check on 2027 files; the commit 5d3cccc1 fixes both and is what the second run measures.
  • Registered rows read against both runs: List the shipped rules that rest on one project, and the second model that could test each #1636 (comment)

Settled in review: the member rule reaches 6,320 curtain wall mullions of the 2027 samples on the strength of the class (the pairs hold two stringers and no mullion); the exporter's source takes a typed mullion through the member creator as it does a stringer, so the class stays. Beams, columns, plates, coverings, ramps, piles, fasteners and family-based curtain walls are left out by the same source when typed, and no 2027 export holds one: a labelled extension is filed as a follow-up.

The widened scorer found more than #1692 asked for: rvt-rs writes none or NOTDEFINED where Revit writes a value on 3,842 of 4,359 walls, all 378 railings, 25 of 43 roofs, 82 of 116 proxies and five more classes of the 42 models with a Revit export. That is filed as #1713 and is not changed here.

Audit-honesty checklist

  • A user-visible change has its entry as a fragment under changelog.d/changed/.
  • docs/status.md states the leave-out and what is not measured on 2027.
  • No emojis, no private paths in committed files.
  • Reverse-engineering finding: the census is the evidence, from tools/re/predefined_types_vs_ifc.py; held-out models appear as counts only.

Legal and contribution hygiene

  • Apache-2.0. No Autodesk proprietary source, internals or NDA material.
  • No new test fixtures.

Breaking changes

An element of the ten classes in a Revit 2027 save has PredefinedType $ where it had an enumerator.

Related issues

Closes #1692. Follow-up: #1713.

…lement type and every space, and the held-out scrub keeps their counts (#1692) (RE-427)

The scorer paired eight classes by Tag. It now pairs every IfcElement class that declares a PredefinedType the same way, counts the elements one file holds and the other does not by class, tallies the PredefinedType of every IfcElementType class and of every IfcSpace, rooms and areas included, and opens each file once. The held-out scrub keeps the new lines as counts beside IFC class names.
…t and declares one, ports among them, and not only the spaces (#1692) (RE-427)
…ts stairs, stair flights, slabs, members, furniture, doors, windows, walls, railings and roofs, as Revit's own export writes none (#1692) (RE-427)

On the two held-out pairs saved by 2027, Revit's export writes no PredefinedType on 71 elements of those ten classes, where its export of the same projects saved by 2024 to 2026 writes one. It still writes one on the building element proxies, the opening elements, the spaces and every type object, which are written as before, so the types, their GlobalIds and the property sets that depend on a predefined type do not change. A class the two pairs do not hold keeps its value.
…one answer for the writer, the viewer's panel, the schedule and the MCP server, and the schema check follows it (#1692) (RE-427)

The first unfiltered run of the leave-out (43012719379) failed two checks on the 2027 files: the MCP consistency check (the server answered the element's predefined type, the export wrote none: 31 and 24 differ on the two pairs) and the schema arity check (a null PredefinedType on a door, member, slab, wall or window). category_map::predefined_type_left_out is the one answer; the writer, the element panel, the schedule CSV and the MCP server ask it, and the schema check reads the release from the project's description and does not require a value on the ten classes from 2027.
…pe and space, and the ten classes it writes none on (#1692) (RE-427)

The report, the criteria entry and the reconnaissance addendum for the 2027 leave-out and the widened scorer, with the registered rows read against the runs.
…edType, and that the exporter's build decides (#1692) (RE-427)

Autodesk's public exporter source (revit-ifc, IFCInstanceExporter.cs, tag IFC_v27.4.0.30) writes an occurrence's PredefinedType only where the element has no type object when it is created, from its tag v27.3.0.12 and in none of v24.3.40, v25.4.40, v26.4.1, v27.0.1 and v27.0.1.1. So the exporter's build decides and not the save's release, as for ObjectType (#1472). A typed mullion goes through the member creator as a stringer does, so the member rule stays at the class.
@DrunkOnJava
DrunkOnJava merged commit a0dd781 into main Nov 11, 2026
36 checks passed
@DrunkOnJava
DrunkOnJava deleted the research/1692-predefined-types branch November 11, 2026 12:52
DrunkOnJava added a commit that referenced this pull request Nov 11, 2026
…ngs from 2027, as the exporter's source does (#1716) (#1764)

## Summary

A Revit 2027 save is now written without a `PredefinedType` on the
occurrence of beams, columns, plates and coverings as well as on the ten
classes #1692 measured. The extension is taken from Autodesk's public
exporter source and not from a measured export: no Revit 2027 export in
the repository holds one of these four classes, so nothing measures it.
The measured ten stay in their own constant, the four are a second one,
and the predicate that the writer, the viewer's panel, the schedule CSV
and the MCP server all ask chains the two.

## Evidence

**What I read.** #1716 and #1714 (body, files, diff), RE-427 sections 3
and 4, `src/ifc/category_map.rs` (`PREDEFINED_TYPE_LEFT_OUT_FROM`,
`PREDEFINED_TYPE_LEFT_OUT_CLASSES`, `predefined_type_left_out`, the
`MAPPINGS` rows, `PREDEFINED_TYPE_ENUMERATORS`,
`EXPORT_OVERRIDE_TARGETS`), `src/ifc/step_writer.rs` (the occurrence's
attribute tail and `type_entity_for`), `src/ifc/export_content.rs`
(where an element's predefined type is chosen and where a property set's
scope is matched), `src/ifc/standard_property_sets.rs`, the three other
callers (`scene_graph.rs`, `schedule_csv.rs`, `rvt-mcp/src/views.rs`),
`tools/ci/ifc_schema_arity.py`, `tools/ci/ifc4_property_sets.py`,
`tools/ci/validate-real-ifc.py`, `docs/status.md`,
`docs/release-1.0-criteria.md`, `changelog.d/README.md` and two existing
fragments.

**The rule.** Autodesk's public exporter source (revit-ifc,
`Source/Revit.IFC.Export/Toolkit/IFCInstanceExporter.cs`, tag
`IFC_v27.4.0.30`; CLEANROOM.md source 5, cited and not quoted) writes an
occurrence's `PredefinedType` only where the element has no type object
when it is created. Its callers include the creators of beams, columns,
plates, coverings, ramps, ramp flights, piles, mechanical fasteners,
family-based curtain walls and grids, so a typed element of those
classes is left out by the same rule that #1692 measured on ten classes.
The helper first appears in `v27.3.0.12`, so the exporter's build
decides and not the save's release (the caveat of #1472).

**What rvt-rs writes today.** `IFCBEAM` `.BEAM.` (StructuralFraming),
`IFCCOLUMN` `.COLUMN.` (Column, StructuralColumn), `IFCPLATE`
`.CURTAIN_PANEL.` (CurtainWallPanel) and `IFCCOVERING` `.CEILING.`
(Ceiling). Checked in the evidence export of nordic-office-as-built:
`rvt-rs.ifc` writes `.BEAM.`, `.COLUMN.`, `.CURTAIN_PANEL.` and
`.CEILING.` on those classes, and Revit's own 2024 export of the same
model writes the same values on the same Tags. The 2027 samples hold
beams (`rst_basic` 370), columns, plates and coverings that rvt-rs
writes a value on, and no Revit 2027 export of them exists.

**What the extension leaves out, and why.**
- A ramp, ramp flight, pile, mechanical fastener and grid are left out
by the same source, and rvt-rs writes no `PredefinedType` on any of
them: no mapping row carries one, none is in
`PREDEFINED_TYPE_ENUMERATORS`, and none is an export-override target.
Listing them would change no file, so they are named in the constant's
doc and not in the list.
- `IFCCURTAINWALL` is not added. The source's family-based curtain wall
is not the system curtain wall and curtain panel wall that rvt-rs writes
as that entity (they go through the exporter's curtain system creator,
as the existing note on `export_override_applies` records), and no 2027
export holds one, so the value stays: fail closed.
- Footings, shading devices and the MEP terminals are not in the
source's list and keep their value.

**What does not move.** The type objects, their GlobalIds and the
property sets that depend on a predefined type take the element's value
as before: `type_entity_for` is called with the unfiltered value, and
the property set scope is matched against the model's value, not the
written attribute. So `Pset_CoveringCeiling` and the type objects of the
four classes are unchanged.

## Changes

- `src/ifc/category_map.rs`: new
`PREDEFINED_TYPE_LEFT_OUT_CLASSES_FROM_SOURCE` (`IFCBEAM`, `IFCCOLUMN`,
`IFCCOVERING`, `IFCPLATE`), chained in `predefined_type_left_out`; the
measured ten stay in `PREDEFINED_TYPE_LEFT_OUT_CLASSES`, and the docs of
both, of `PREDEFINED_TYPE_LEFT_OUT_FROM` and of the predicate say which
is measured and which is from the source.
- `src/ifc/step_writer.rs`: the comment at the call site no longer
counts ten classes.
- `tools/ci/ifc_schema_arity.py`: `IfcBeam`, `IfcColumn` and
`IfcCovering` added to `PREDEFINED_TYPE_LEFT_OUT` (the three of the four
that `PREDEFINED_TYPE_REQUIRED` holds), or the arity check fails on a
2027 file that now writes a null there.
- `docs/status.md` and `docs/release-1.0-criteria.md`: the sentence that
said every class the 2027 pairs do not hold keeps its value is
corrected, and the extension is labelled as taken from the exporter's
source and not from a measured export.
- `changelog.d/changed/1716-predefined-type-from-source.md`: new
fragment.

## Measured

One Measure run scored this change together with the four others it was
drafted beside (run 43058225020, head `d17975d3`, base `aa5dc4c6`):
every model, with the BIM4LCA office and housing, the 23 Revit 2025
models, Autodesk's samples of every release, rac_advanced, BIMcollab and
the held-out pairs. All 39 shards and both same-project gates passed,
and the check run `same-project gates` on `d17975d3` reads pass. 20 of
126 exports change; each changed row carries the name of the value its
change writes, so the rows below are this change's alone. A second run
kept both sides' exports of the 25 sample saves of 2024 to 2027, which
no Revit export scores, and they were compared entity by entity with the
step ids taken out (run 43073245751). A third measured the four office
files with `--revit-set-placement`, as W7 is measured (run 43073951032).
After the second read's two fixes, the stack's final head with `main`
merged (`e41d96b5` against `39826420`) was measured again in full (run
43077331708, rows registered on #1636 before it was read): every row
below repeats, 24 of 126 exports move and no other, and both
same-project gates pass on that head.

This change removes a value and no Revit 2027 export holds one of these
four classes, so nothing scores it; what was checked is that it does
exactly what it says and nothing else.

| 2027 save | `IfcBeam` | `IfcColumn` | `IfcCovering` | `IfcPlate` |
|---|---:|---:|---:|---:|
| `rac_advanced` | 38 | 176 | 65 | 1,349 |
| `rac_basic` | 0 | 3 | 2 | 44 |
| `rme_advanced` | 0 | 135 | 43 | 629 |
| `rme_basic` | 0 | 135 | 43 | 629 |
| `rst_basic` | 370 | 30 | 0 | 0 |

- Those are the occurrences whose `PredefinedType` goes from a value to
unset. On each of the five exports no entity is added or removed and no
other argument of any entity changes (the kept-export comparison); the
`IfcOwnerHistory` time stamp aside.
- Every 2024, 2025 and 2026 save is unchanged by this change, and no
census row of the two held-out 2027 pairs moves: they hold none of the
four classes.
- `tools/ci/ifc_schema_arity.py`, with the edit this change makes to it,
passes on every 2027 export, and no model's `schema.txt` changes.

## Still open

- The evidence is the exporter's public source (revit-ifc, tag
`IFC_v27.4.0.30`, cited in the constant's doc), as #1716 allows, not a
measured export. A 2027 pair that holds a beam, column, plate or
covering would measure it.
- The exporter's build decides this, not the save's release (#1472);
rvt-rs decides by release.
- #1716 also names ramps, ramp flights, piles, fasteners and grids, on
which rvt-rs writes no `PredefinedType`, and the family-based curtain
wall, which is not the system curtain wall rvt-rs writes. None is
changed here, so the issue can close with this.

Stack: this is change 4 of 5 measured together; each branch holds the
ones before it, so its own diff is its last commit until those land.
First draft: #1728.

## Testing

- Built, linted and tested by CI on this head; nothing was built on a
workstation.
- Verified end to end on real Revit files against Revit's own exports:
the Measure runs named above, which anyone can repeat with `gh workflow
run measure.yml --ref main -f ref=<this head> -f
base=aa5dc4c6d93e861015c10e0a0d8f9f16c8b57e71 -f nordic=true -f
r2025=true -f samples=true -f racadv=true -f bimcollab=true -f
holdout=true`.
- No test was added: no unit test, and no pinned count moves except
where the body says so.

## Audit-honesty checklist

- [x] Docs state what this change writes and what it leaves out
- [x] A changelog fragment under `changelog.d/`
- [x] No emojis, private paths or personal data in committed files
- [x] Limits are in the body above and in the code's doc comments

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary source, decompiled internals or NDA
material. Where revit-ifc (CLEANROOM.md source 5) is cited, it is read
and cited by file and class, and no code is copied.
- [x] No fixture with real-world personal data

## Breaking changes

None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant