Title: cannot change spatial container of a door filling a wall · Issue #8138 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: cannot change spatial container of a door filling a wall · Issue #8138 · IfcOpenShell/IfcOpenShell
X Title: cannot change spatial container of a door filling a wall · Issue #8138 · IfcOpenShell/IfcOpenShell
Description: Bug Description bpy.ops.bim.assign_container(container=
Open Graph Description: Bug Description bpy.ops.bim.assign_container(container=
X Description: Bug Description bpy.ops.bim.assign_container(container=<id>) (and the Spatial Manager UI flow) silently no-ops when called on an IfcDoor / IfcWindow — no error, the filling's IfcRelContai...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/8138
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"cannot change spatial container of a door filling a wall","articleBody":"### Bug Description\n\n`bpy.ops.bim.assign_container(container=\u003cid>)` (and the Spatial Manager UI flow) silently no-ops when called on an `IfcDoor` / `IfcWindow` — no error, the filling's `IfcRelContainedInSpatialStructure` stays on its previous storey. Repro: create a wall on Storey A with a door filling, move the wall to Storey B (door is left behind on A — see #7801), then try to fix the door manually with `bpy.ops.bim.assign_container(container=\u003cB_id>)`. Nothing happens. Same outcome if you duplicate a door from Storey A and use it to fill an opening in a wall on Storey B.\n\nRoot cause: `Spatial.get_root_element` in `tool/spatial.py` walks up through `get_filled_void` + `get_voided_element` (added in ff35666ad, \"Reimplement feature to reassign inherited containers if you select a child element\"), so for a door it returns the host wall. `core.assign_container` then runs `spatial.assign_container` on the wall — which the API correctly no-ops if the wall is already in the target storey, leaving the door's stale `ContainedInStructure` untouched. This treats fillings as inheriting their container from the host, but IFC4 / IFC4.3 explicitly say the opposite — [`IfcDoor`](https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcDoor.htm) / `IfcWindow` docs: *\"The containment shall be defined **independently of** the filling relationship, that is, even if the IfcDoor is a filling of an opening established by IfcRelFillsElement, it is also contained in the spatial structure by an IfcRelContainedInSpatialStructure\"*, default container `IfcBuildingStorey`. Major exporters (Revit, ArchiCAD, Tekla, Allplan) all write independent containers on doors/windows accordingly.\n\nProposed fix: drop `get_filled_void` and `get_voided_element` from `get_root_element` so fillings are their own root for container assignment (aggregation + nesting remain — those are true sub-part relationships). Schema-aligned, matches existing exporter behaviour, fixes both this and #7801 from the other direction. Separately there's an unrelated typo at `core/spatial.py:67` — the comprehension uses outer-loop variable `root_element` instead of comprehension variable `e`, which accidentally works for single-object selection but filters all-or-nothing for multi-selection. Happy to send a PR with both fixes + tests if there's agreement.\n\n---\n\n*Issue drafted with AI assistance.*\n\n\n### Attachments\n\n_No response_\n\n### Debug and Error Output\n\n```true\n\n```","author":{"url":"https://github.com/Gorgious56","@type":"Person","name":"Gorgious56"},"datePublished":"2026-06-02T12:41:42Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/8138"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d87ed2c5-f19e-d051-c57e-be707fc79ccf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A45C:9393C:35B9AA:47B1EB:6B04B996 |
| html-safe-nonce | cda5d38485e577e0ef19265c0d9bcf44081f2436100bc53a61cbb8ad54980ebd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDVDOjkzOTNDOjM1QjlBQTo0N0IxRUI6NkIwNEI5OTYiLCJ2aXNpdG9yX2lkIjoiNTgyMDIyMzAyNjI4MDgzOTU3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 84baaf34c592404b36f09b314552564580975cfe30eca59ebd5af93cb490dee0 |
| hovercard-subject-tag | issue:4571500182 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/8138/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a987ec087be24bd957b03f35bc9dda5e150ab02ce4bfdb05783a1a3cec01ca3a/IfcOpenShell/IfcOpenShell/issues/8138 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a987ec087be24bd957b03f35bc9dda5e150ab02ce4bfdb05783a1a3cec01ca3a/IfcOpenShell/IfcOpenShell/issues/8138 |
| og:image:alt | Bug Description bpy.ops.bim.assign_container(container= |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Gorgious56 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7 |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b032e77f1ea437ede6c115446a0a467709b468e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width