Title: ExtractElements / append_asset: IfcPresentationLayerAssignment copied with empty AssignedItems (SET [1:?]) · Issue #9419 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: ExtractElements / append_asset: IfcPresentationLayerAssignment copied with empty AssignedItems (SET [1:?]) · Issue #9419 · IfcOpenShell/IfcOpenShell
X Title: ExtractElements / append_asset: IfcPresentationLayerAssignment copied with empty AssignedItems (SET [1:?]) · Issue #9419 · IfcOpenShell/IfcOpenShell
Description: Description ifcpatch ExtractElements copies IfcPresentationLayerAssignment into the new file, but leaves AssignedItems empty. IfcShapeRepresentation of the extracted products is present. ifcopenshell.validate (express_rules=False) report...
Open Graph Description: Description ifcpatch ExtractElements copies IfcPresentationLayerAssignment into the new file, but leaves AssignedItems empty. IfcShapeRepresentation of the extracted products is present. ifcopenshe...
X Description: Description ifcpatch ExtractElements copies IfcPresentationLayerAssignment into the new file, but leaves AssignedItems empty. IfcShapeRepresentation of the extracted products is present. ifcopenshe...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9419
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ExtractElements / append_asset: IfcPresentationLayerAssignment copied with empty AssignedItems (SET [1:?])","articleBody":"## Description\n\n`ifcpatch` `ExtractElements` copies `IfcPresentationLayerAssignment` into the new file, but leaves `AssignedItems` empty. `IfcShapeRepresentation` of the extracted products is present. `ifcopenshell.validate` (`express_rules=False`) reports `AssignedItems` / `Not valid`. `file.write()` does not drop the assignment.\n\nThis looks like a follow-on to #6023 (layers started being copied via `project.append_asset`). The assignment entity is created; the SET is never filled.\n\nA second leftover on the same extract: unused `IfcLocalPlacement` with empty inverse `PlacesObject` (SET [1:1] on IFC2X3). Those placements are not `ObjectPlacement` of any remaining product and are not ancestors of a used placement chain. Also survives `write()`.\n\nSource IFC will be attached in a follow-up comment.\n\n## How to reproduce\n\nIFC2X3 source: [Issuemodel_9419.ifc](https://acc.autodesk.com/build/share/projects/32b812a0-2256-4362-85f5-0216e4af787b/files?shareId=e275eaa6-81d6-4159-80e0-7b0d8c3d7703)\n\nSource state:\n\n- One `IfcPresentationLayerAssignment` named `KALKZANDSTEEN`\n- `AssignedItems`: 286 `IfcShapeRepresentation` (exactly the body representations of 286 walls)\n\nExtract those 286 walls with `ExtractElements` (`assume_asset_uniqueness_by_name=False`):\n\n```python\nfrom ifcpatch.recipes.ExtractElements import Patcher\n\nsrc = ifcopenshell.open(\"Issuemodel_9419.ifc\")\npatcher = Patcher(file=src, query=\", \".join(wall_guids), assume_asset_uniqueness_by_name=False)\npatcher.patch()\nfrag = patcher.file\n```\n\n## Expected\n\n- `KALKZANDSTEEN.AssignedItems` contains the 286 `IfcShapeRepresentation` that were copied, **or**\n- the assignment is omitted if the SET would be empty\n\nUnused `IfcLocalPlacement` with empty `PlacesObject` should not remain.\n\n## Actual\n\nAfter extract (in-memory and after `write()` + reopen):\n\n| Check | Result |\n|---|---|\n| Layer `KALKZANDSTEEN` | still present |\n| `AssignedItems` | `()` |\n| Wall `IfcShapeRepresentation` | 286 still in the file; `LayerAssignments` inverse empty |\n| `IfcLocalPlacement` with empty `PlacesObject` | 8, disjoint from used placement chains |\n| `ifcopenshell.validate` | `AssignedItems` / `Not valid`; `IfcLocalPlacement.PlacesObject` / `Not valid` |\n\nSource vs fragment for the layer: 286 items to 0 items. The representations were not deleted; they were not re-linked.\n\n## Version\n\n- `ifcopenshell` / `ifcpatch` `0.8.6-alpha260823` (`version_core` `0.8.6-e333c1c`, Bonsai `bonsai-0.8.6-alpha2608231542`)\n- Same `append_asset` layer branch is still in `bonsai-0.8.6-alpha2609011735` (identical `ExtractElements.py` / `append_asset.py` blobs) and in `bonsai-0.9.0-alpha2609011726` (`66bcddc`)\n- Windows, Python 3.12\n- Source schema: IFC2X3\n\n## Likely cause\n\n`ifcopenshell.api.project.append_asset.add_inverse_element`:\n\n1. For `IfcPresentationLayerAssignment`, `AssignedItems` only keeps items already in `reuse_identities`. Anything not yet copied is skipped (`skip_not_reused_entities_attr_i = 2`).\n2. If the assignment is already in `reuse_identities`, the method returns immediately unless the entity is an `IfcRelationship`. `IfcPresentationLayerAssignment` is not a relationship, so later products never extend `AssignedItems`.\n\nFirst wall creates the layer, often with an empty SET. Later walls hit the early `return`. Result: one empty assignment and all representations unassigned.\n\n## Related\n\n- #6023 — `append_asset` / `ExtractElements` did not copy layers at all; copy was added, SET membership was not completed","author":{"url":"https://github.com/PahlawanJoey","@type":"Person","name":"PahlawanJoey"},"datePublished":"2026-09-01T17:53:41Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9419"}
| 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:85935050-4eb1-6f8f-0511-77c8dda41981 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8B4:96A74:10F354:16A935:6B04B0F5 |
| html-safe-nonce | b21340a4f8b4ca1a603222b5ea1239ea5ec4dbc43e0cc71112ef27063b1e0323 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEI0Ojk2QTc0OjEwRjM1NDoxNkE5MzU6NkIwNEIwRjUiLCJ2aXNpdG9yX2lkIjoiNTMyNTI4MTMzNzM3MTA0NjEzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8e8f132155fdfd80512b5ad1f461c305c299d8cf2637bc116ce1710ec932ffc8 |
| hovercard-subject-tag | issue:5315062523 |
| 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/9419/issue_layout |
| twitter:image | https://opengraph.githubassets.com/214ced97c82cc8bfd67e8c4d233552113ac56cb669fd4ba0cd1bfddcf333d23e/IfcOpenShell/IfcOpenShell/issues/9419 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/214ced97c82cc8bfd67e8c4d233552113ac56cb669fd4ba0cd1bfddcf333d23e/IfcOpenShell/IfcOpenShell/issues/9419 |
| og:image:alt | Description ifcpatch ExtractElements copies IfcPresentationLayerAssignment into the new file, but leaves AssignedItems empty. IfcShapeRepresentation of the extracted products is present. ifcopenshe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PahlawanJoey |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| 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 | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| 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