Repository navigation
fix(ifc): an element whose IFC export parameters differ between the partitions of a Revit 2024 or later file takes its current copy's value, as Revit's export writes it (#1713) - #2002
Merged
Conversation
…artitions of a Revit 2024 or later file takes the latest partition's value, as Revit's export writes it (#1713)
DrunkOnJava
marked this pull request as ready for review
November 14, 2026 08:57
…ent copy through current_partitions, and a roof exported as IfcSlab keeps its saved mesh (#1713) The scan now collects the owner and key pairs whose partitions disagree and resolves them with native_document::current_partitions, the rule the native record read uses (RE-145, RE-216), so both readers share one answer; an element it has no current copy for leaves the key out instead of taking a guess. An element whose latest "Export to IFC As" is IfcSlab but whose class is Roof had its saved mesh replaced by the sketch body, because is_replaceable_box asked the exported type, not the Revit class, whether it was a roof. It asks both now, so the roof keeps its mesh and takes only the class and the quantities from the override.
…hosen among every partition that holds the element's data, with one routing call (#1713) A parameter cleared in the current partition is read as no entry there (an empty value is not a value), so choosing among only the partitions that hold the key would let an older partition's value win. The pairs whose copies disagree now give their owners' partitions to current_partitions, the way scan_type_layers does (RE-446): the partitions where the owner's data object appears at all, whatever keys it carries. A current partition without the key leaves it out. One call routes every owner, not one per key.
3 of 4 tasks
…ntity carries RedirectedRoof, so the saved-mesh pass still replaces its sketch body (#1713) The previous commit tested the record's schema class for "Roof", but a footprint roof's class is ProfileRoof (RE-76), so the 7 roofs of the BIM4LCA timber office written as IfcSlab still lost their saved mesh to the sketch body (mesh_bodies IfcSlab rows 22 to 15 in Measure 43579535220). The element's category is the exact fact and no property carries it: the exporter, which knows both the category's entity and the redirected one, now marks a roof it writes as another entity, and is_replaceable_box reads the mark.
… what the saved-mesh pass does with it (#1713)
…ues takes its current copy, in the support matrix and the compatibility notes (#1713)
…h outline to the saved mesh, and the viewer's layers they lose (#1713)
DrunkOnJava
added a commit
that referenced
this pull request
Nov 14, 2026
…er's owner appears and what each rule for its current copy answers (#1713) (#2004) ## Summary The probe `probe_1713_export_parameter_copies` reads all four IFC export parameters of a declared element and, for each owner whose partitions disagree about one, routes it through `native_document::current_partitions` by the partitions its data object appears in, and prints that answer beside two simpler rules: the same call over only the partitions that hold the key, and the latest partition that holds it. It also counts the owners whose routed partition holds the element's data with no entry for the key (a parameter cleared there, since an empty value is no entry). It is the evidence behind #2002's choice of rule. Part of #1713. On the six BIM4LCA files of Revit 2024 (Measure [43579785358](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43579785358), `c4fa075c`), 84 owners hold 93 owner-and-key pairs that disagree: 2 on the concrete housing as built (one wall type), 1 at permit, 19 on the office at permit and 71 on the timber office at permit (63 owners, 8 of which also disagree about "Export to IFC As"). All 93 are routed, the routed partition holds a value in every one, none is in doubt, none holds the element's data without an entry for the key, and the three rules answer the same on all 93 (the routed partition is not the latest holder on 2 pairs of the timber office, with the same value). The two as-built office files have no pair that disagrees. ## Motivation A review of #2002 asked whether the partitions to choose among should be those that hold the key or those that hold the element's data, as `scan_type_layers` does (RE-446). The two differ only where the current partition has the element's data and no entry for the key; this probe counts those and finds none on the files that disagree. ## Changes - `probes/examples/probe_1713_export_parameter_copies.rs`: the four export parameters instead of the two predefined types, per-partition copies (a partition with two values is a copy in doubt), the partitions where each owner's data object appears, and the routing counts above. Unpublished probe crate, nothing else. ## Testing Registered before the run: on the files whose pairs disagree the routed partition holds the key in every pair and the three rules agree; a pair whose routed partition has the element's data and no entry would show as "no entry for the key". Measure [43579785358](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43579785358) on `c4fa075c`, `models` the six BIM4LCA files above, no scorer, no base: 1. **Holds.** 93 pairs disagree on 84 owners; 93 of 93 routed, 93 of 93 hold a value in the routed partition, 0 in doubt, 0 with no entry for the key. 2. **Holds.** The rule over the owner's partitions, the rule over the key's partitions and the latest partition give the same answer on 93 of 93. 3. The commit after it (`591b7485`) changes two spellings clippy's `-D warnings` refused (`explicit_auto_deref`, `unnecessary_get_then_check`) and nothing else; the output does not change. - [ ] `tools/check-local.sh`: no local builds; `rustfmt --check` passes; CI runs the rest. ## Audit-honesty checklist - [x] The Summary states the counts the run showed. - [x] No private paths or emojis. ## Legal and contribution hygiene - [x] Apache-2.0; no Autodesk source; no fixtures. ## Breaking changes None. ## Related issues Part of #1713; supports #2002.
This was referenced Nov 14, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Nov 14, 2026
…fined type where that is an IFC4 enumerator, so the USERDEFINED proxy of each BIM4LCA file is written as in Revit's export (#1713) (#2009) ## Summary A building element proxy takes its own or its type's "IFC Predefined Type" where that is one of IFC4's `IfcBuildingElementProxyTypeEnum` enumerators, as a railing, a wall, a ramp, a light fixture, a pipe segment and a door already do (#1765, #1787, #2001). In each of the twelve BIM4LCA files (six housing, six office) one proxy carries `USERDEFINED` as its own "IFC Predefined Type" under an "Export to IFC As" of `IfcBuildingElementProxy` (probe, Measure 43588996635: element 1337778 of the housing files, 1337610 of the office), Revit's export writes `USERDEFINED` on it, and rvt-rs left it unset. A proxy with no value keeps the `NOTDEFINED` of `NOTDEFINED_DEFAULTS`. Part of #1713. Measure 43589444447 (`5e15df52` against `main`, unfiltered) moves those 12 exports and no other: - `IfcBuildingElementProxy`: 116 in both, same 104 to 116, unset 12 to 0; differs and `NOTDEFINED` where Revit writes none stay 0. Per file the proxy reads `USERDEFINED`: same 2 to 3 of 3 on the four large housing files, 0 to 1 of 1 on the two housing terrain files, 11 to 12 of 12 on the office as built and at permit, 10 to 11 of 11 on its two timber files, 0 to 1 of 1 on its two terrain files. - `IfcBuildingElementProxyType`: each type object follows its proxy, so rvt-rs's `USERDEFINED` goes from 0 to 12 (Revit's 12) and its `NOTDEFINED` from 54 to 42 (Revit's 36; the 6 type objects more than Revit's are not this change). - `diagnostics.json`: 102 of 102 identical. The held-out pairs and every other export are identical. ## Motivation #1713's census after #2002: `IfcBuildingElementProxy` 116 in both, 104 same, 12 unset where Revit writes `USERDEFINED`, 0 differs, 0 `NOTDEFINED` where Revit writes none. The class was left out of `PREDEFINED_TYPE_ENUMERATORS` because listing a class applies the own value of every element a category maps to it, which was not measured for proxies. ## Changes - `src/ifc/category_map.rs`: `IFCBUILDINGELEMENTPROXY` and its seven enumerators in `PREDEFINED_TYPE_ENUMERATORS`, with the evidence in the table's doc comment. - A changelog fragment. ## Testing Measure [43589444447](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43589444447): `5e15df52` against `main` at `32ed4e6a`, unfiltered with nordic, r2025, samples, holdout and racadv. 1. **Holds.** The 12 unset proxies read `USERDEFINED`, equal to Revit's; no proxy of the 42 models, nor of the held-out pairs (counts only: 48 of 48 same, before and after), changes value otherwise. 2. **Holds.** 114 of 126 exports are identical to `main`'s, and so are all 102 `diagnostics.json` files; the 60 scorer lines that move are the proxy and proxy-type rows of the 12 files (5 each). 3. **Not shown.** A proxy whose "IFC Predefined Type" is text that is no enumerator is left unset, as before: no measured file holds one. - [ ] `tools/check-local.sh`: no local builds; `rustfmt --check` passes; CI runs the rest. ## Audit-honesty checklist - [x] The Summary states each change the run showed, with its count. - [x] A changelog fragment. - [x] No private paths or emojis. ## Legal and contribution hygiene - [x] Apache-2.0; no Autodesk source (the rule is Revit's measured export); no fixtures. ## Breaking changes None. ## Related issues Part of #1713.
DrunkOnJava
added a commit
that referenced
this pull request
Nov 14, 2026
…its own or its type's is NOTDEFINED on Revit 2024, as Revit's export writes it (#1713) (#2008) ## Summary A ramp or a geographic element with no "IFC Predefined Type" of its own or its type's is written with the `PredefinedType` `NOTDEFINED` on Revit 2024, as Revit's export writes it. After #2002 the residual census of #1713 (Measure 43583771747, 42 models with a Revit export) had 6 `IfcRamp` and 6 `IfcGeographicElement` unset where Revit writes `NOTDEFINED`, with "differs" and "NOTDEFINED where Revit writes none" at 0. The two entries join furniture, roofs, stairs, stair flights, proxies and railings in `NOTDEFINED_DEFAULTS`, on 2024 only: no other measured file and no held-out pair holds a ramp or a geographic element in both exports (RE-353). Part of #1713. Measure 43588992984 (`621e4707` against `main`, unfiltered) moves 7 exports: - `IfcRamp`: the one ramp of each of the six BIM4LCA housing files reads `NOTDEFINED`, unset 1 to 0 and same 0 to 1 on every file (38 in both on the 42 models, same 32 to 38). - `IfcGeographicElement`: 3 of the 23 on each of the two housing terrain files read `NOTDEFINED`, unset 3 to 0 and same 20 to 23 of 23 (Revit writes `NOTDEFINED` on 3 and `USERDEFINED` on 20). - The seventh export is Autodesk's Snowdon Towers architectural sample (no Revit export on Measure), whose 2 ramps now carry `NOTDEFINED`, as Revit's local IFC4 export of the sample writes on both. - `diagnostics.json`: 102 of 102 identical. The held-out pairs and every other export are identical. ## Motivation #1713's table: `IfcRamp` was 6 unset after #1787 ("a ramp Revit writes `NOTDEFINED` on"), and the geographic elements of the terrain files were not in it. ## Changes - `src/research/partition_schema_mvp/fields.rs`: `("IFCRAMP", &[2024])` and `("IFCGEOGRAPHICELEMENT", &[2024])` in `NOTDEFINED_DEFAULTS`, with their evidence in the table's doc comment. - A changelog fragment. ## Testing Measure [43588992984](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43588992984): `621e4707` against `main` at `32ed4e6a`, unfiltered with nordic, r2025, samples, holdout and racadv. 1. **Holds.** On every model that had one, "unset in rvt-rs" goes to 0 and "same" rises by the same: 6 of 6 ramps and 6 of 6 geographic elements. "Differs" and "NOTDEFINED where Revit writes none" stay 0 in every class of every model. 2. **Holds.** 119 of 126 exports and 102 of 102 `diagnostics.json` files are identical to `main`'s; the 28 scorer lines that move are the ramp and geographic-element rows of the six housing files. 3. **Not shown.** No file of another release holds either class in both exports, so neither default is measured outside Revit 2024 (RE-353). - [ ] `tools/check-local.sh`: no local builds; `rustfmt --check` passes; CI runs the rest. ## Audit-honesty checklist - [x] The Summary states each change the run showed, with its count. - [x] A changelog fragment. - [x] No private paths or emojis. ## Legal and contribution hygiene - [x] Apache-2.0; no Autodesk source (the rule is Revit's measured export; `revit-ifc`'s `IFCExportInfoPair` is cited, not quoted); no fixtures. ## Breaking changes None. ## Related issues Part of #1713.
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 Revit 2024 and later an element whose IFC export parameters ("IFC Predefined Type", "Export to IFC As" and their type counterparts) differ between the partitions of a file takes its current copy's value, found among the partitions that hold its data with
native_document::current_partitions(RE-145, RE-216; RE-446 does the same for a type's layers). The scan dropped such a key, and the BIM4LCA permit files edit it in a later partition. An element with no current copy, or whose current partition has no entry or two values for the key, leaves it out. Part of #1713. Measure 43583771747 (413f395cagainstmain, unfiltered) moves eight BIM4LCA files, each change to what Revit's export writes:IfcWallwith no predefined type, 8, 19 and 13 on the housing, office and timber office at permit, now reads Revit's (PARTITIONING,SOLIDWALL,SHEAR; 345, 589 and 586 same); their wall types follow. 42IfcSpacefamily instances of the timber office readUSERDEFINED(86 same, from 44).IfcSlabbecomeIfcSlabROOF(58 same, from 50;IfcRoof9 to 1), and 1 wall of the concrete housing as built anIfcCovering(88 same, from 87).IfcRoofkeeps its saved mesh, as a roof written asIfcRoofdoes: the exporter marks itRedirectedRoofand the saved-mesh pass reads the mark; without it the 8 above would lose their meshes to their sketch outlines. The mark is also on roofs thatmainalready wrote as another entity, so 52 bodies in the eight files change from a sketch outline to the mesh Revit drew: 48IfcSlabroofs (6, 5, 4, 4 on the housing files, 10 and 10 on the office, 8 on the timber office as built, 1 on its permit) and theIfcSolarDeviceroof of each housing file (4). 50 of the 52 match Revit's in all six measures, 2 in five.Motivation
#1713 listed the 40 walls and 42 spaces as "not yet read". Probe
probe_1713_export_parameter_copies(#2004, Measure 43579785358): 93 owner-and-key pairs of 84 elements disagree on six files, all routed, the routed partition holds a value in each, none is the cleared case, and the routed rule, the key's partitions and the latest partition answer alike on all 93.Changes
src/research/partition_ifc_export_overrides.rs:scan_export_parametersresolves the pairs that disagree with onecurrent_partitionscall over their owners' partitions.src/ifc/export_content.rs,src/ifc/saved_meshes.rs: theRedirectedRoofmark andis_replaceable_boxreading it.export-diagnostics.md,compatibility.md,support-matrix.json, and a changelog fragment.Testing
Registered before the first run: walls and spaces read Revit's and nothing else differs. The runs found more (the roofs, and the bodies they move), each stated above. Measure 43583771747:
same-project gatespass,full / CI passed, 118 of 126 exports and 94 of 102diagnostics.jsonidentical, the four terrain files measured and identical.IfcSlabvertices within 0.01 ft go 40 to 39, 37 to 36, 36 to 35 and 36 to 35 on the four housing files (outlines and areas within tolerance unchanged). The GLB draws these roofs from their mesh and not in layers, as it does a roof written asIfcRoof: layers within 0.001 ft 100 of 127 to 95 of 122 (office as built), 97 of 103 to 92 of 98 (permit), 101 of 102 to 98 of 99 (timber as built), 97 of 98 to 96 of 97 (timber permit); no layer compared turns out wrong.tools/check-local.sh: no local builds;rustfmt --checkpasses; CI runs the rest.Audit-honesty checklist
Legal and contribution hygiene
Breaking changes
None.
Related issues
Part of #1713.