Skip to content

feat(ifc): MEP systems as IfcSystem, grouping their members (B33, #528) - #631

Merged
DrunkOnJava merged 5 commits into
mainfrom
feat/b33-mep-systems
Oct 3, 2026
Merged

DrunkOnJava merged 5 commits into
mainfrom
feat/b33-mep-systems

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

RE-162 (B33, #528). An MEP system is an RbsHvacSystem, RbsPipingSystem or RbsElectricalSystem data object; its members are the exported elements whose own data objects hold its id. HVAC and piping systems are named by the object's first ASCII string, electrical systems by their circuit number (Revit's where it is empty). Writes IfcSystem, IfcRelAssignsToGroup and IfcRelServicesBuildings.

Red on main: CI run 37148704032 (draft #629), RE1 Mechanical 5 of 5 systems missing.
Green: CI run 37149305337, Corpus health tier 2: test re1_mep_systems_are_revits ... ok (all 26 of Revit's systems on RE1 Mechanical, Plumbing and Electrical, same name and members); every other corpus target unchanged. The doc fix follows that run.


Note

Medium Risk
Touches IFC export and partition binary heuristics for system membership; incorrect parsing could mis-group MEP elements, but scope is additive with corpus regression tests.

Overview
Adds end-to-end MEP system export so rvt-rs can write Revit's HVAC, piping, and electrical systems as IfcSystem groups, matching Revit's IFC4 pattern (IfcRelAssignsToGroup + IfcRelServicesBuildings).

A new partition_mep_systems scanner (Revit 2024+) finds RbsHvacSystem, RbsPipingSystem, and RbsElectricalSystem data objects, derives names (ASCII string for HVAC/piping, circuit number for electrical), and infers members from elements whose payloads reference the system id. partition_schema_mvp stamps each exported element with m_mep_system_<id> fields; export_content rolls those into IfcEntity::System records; step_writer emits the STEP entities, skipping systems with no exported building-element members.

Corpus integration test re1_mep_systems_are_revits compares system names and member tags against Revit's RE1 Mechanical/Plumbing/Electrical IFC exports; CI adds the mep_systems target.

Reviewed by Cursor Bugbot for commit 7ef40bd. Configure here.

#528)

Revit's IFC4 exports of the RE1 MEP models write one IfcSystem per MEP
system (5 on Mechanical, 8 on Plumbing, 13 on Electrical, three of the
circuits named 1), each grouping its members by IfcRelAssignsToGroup.
The test requires, for each of them, an rvt-rs IfcSystem of the same
name grouping the same elements among those both exports hold.

Red on main before the implementation (CI run 37148704032, Corpus
health tier 2, draft #629):

    test re1_mep_systems_are_revits ... FAILED
    thread 're1_mep_systems_are_revits' panicked at tests/mep_systems.rs:181:9:
    RE1 Mechanical: 5 of Revit's 5 systems are not rvt-rs's (name, Revit's
    members rvt-rs writes, the member counts of rvt-rs's unmatched systems
    of that name): [("OTH 3", 8, []), ("OTH 2", 2, []), ("Mechanical
    Return Air 1", 8, []), ("Mechanical Supply Air 1", 58, []), ("OTH 1",
    2, [])]
    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
RE-162: an MEP system is an element of its own, a data object of class
RbsHvacSystem, RbsPipingSystem or RbsElectricalSystem holding its name;
its members are the elements whose own data objects hold its id. On the
RE1 Mechanical, Plumbing and Electrical models every one of Revit's 26
IfcSystems is one such object, and every element Revit groups in it holds
the system's id.

partition_mep_systems finds the system objects by class and their members
among the decoded elements; partition_schema_mvp gives each member a field
naming its system; the exporter writes each system as an IfcSystem with an
IfcRelAssignsToGroup of its members and an IfcRelServicesBuildings to the
building, as Revit's export does.
@DrunkOnJava
DrunkOnJava merged commit bf58425 into main Oct 3, 2026
24 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/b33-mep-systems branch October 3, 2026 22:13

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7ef40bd. Configure here.

if *held != name {
*held = None;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreadable copy wipes system names

Medium Severity

A system object whose name cannot be read is stored as None, and any later copy whose name differs from that None clears the stored name. A failed parse on one partition therefore discards a valid name from another copy, so the IfcSystem is emitted unnamed even when a readable object held the name.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7ef40bd. Configure here.

DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
…odel (#35, #528) (#634)

Session 2 statuses: B27, B28, B29, B30, B41 done; B33 (#631) and B39
(#630) in the queue; B40 blocked (Revit's RE1 exports write no non-Pset_
sets, Measure run 37149211122).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only backlog and progress-log edits with no code, CI, or
export behavior changes in this PR.
> 
> **Overview**
> Updates **`BACKLOG.md`** to match session 2 afternoon outcomes—no
runtime or CI code in this diff.
> 
> The session 2 ranked table moves **B27, B28, B29, B30, and B41** from
“in the queue” / “in review” to **done**, marks **B33** and **B39** as
**done (in the queue)**, and reclassifies **B40** from **committed** to
**blocked (a model)**.
> 
> The progress log is expanded in the same spirit: queue markers cleared
for witness CI (**B27**), scorer and property-set items (**B30**,
**B28**, **B41**, **B29**); **B33** now documents **`IfcSystem`** export
for all 26 MEP systems (#631, RE-162, green
`re1_mep_systems_are_revits`); **B39** closes the #228 “leading 3” as a
negative (RE-161, #630); **B40** is blocked because RE1 Revit exports
expose no non-`Pset_` reference property sets (Measure #633). **B29**
notes a Bugbot fix reordering the ceiling finish check before the slab
height gate.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
b3fdbd1. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
…Id 3 (#35) (#635)

Marks B33 (#631) and B39 (#630) done now that they have merged, and #608
done. Corrects B39's line: RE-161 narrowed the leading 3 to ElementId 3
but did not attribute it, so #228 stays open on that element's class
(RE-161 report status: narrowed; not attributed). Docs only.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only backlog and progress-log edits with no runtime or
test impact.
> 
> **Overview**
> Updates **BACKLOG.md** only to match merged work: **B33** (#631) and
**#608** are marked fully **done** (removing “in the queue”), and
**B39** (#630) is **done** with clarified wording.
> 
> **B39** no longer reads as closing **#228**. RE-161 is recorded as
**narrowing** the reference-list leading `3` to **ElementId 3**
(internal, no name entry; not a workset or parameter value) but **not
attributing** it—**#228** stays open on which element/class ElementId 3
is.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5d48139. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant