Title: Bonsai: copying a type-linked occurrence drops occurrence-local representations (e.g. Model/Body/PLAN_VIEW) · Issue #8788 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: copying a type-linked occurrence drops occurrence-local representations (e.g. Model/Body/PLAN_VIEW) · Issue #8788 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: copying a type-linked occurrence drops occurrence-local representations (e.g. Model/Body/PLAN_VIEW) · Issue #8788 · IfcOpenShell/IfcOpenShell
Description: Problem When you duplicate (Shift+D) an occurrence that is connected to a type, any representation that lives only on the occurrence — one whose context the type has no RepresentationMap for — is silently dropped from the copy. Steps to ...
Open Graph Description: Problem When you duplicate (Shift+D) an occurrence that is connected to a type, any representation that lives only on the occurrence — one whose context the type has no RepresentationMap for — is s...
X Description: Problem When you duplicate (Shift+D) an occurrence that is connected to a type, any representation that lives only on the occurrence — one whose context the type has no RepresentationMap for — is s...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/8788
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: copying a type-linked occurrence drops occurrence-local representations (e.g. Model/Body/PLAN_VIEW)","articleBody":"## Problem\n\nWhen you duplicate (Shift+D) an occurrence that is connected to a type, any representation that lives **only on the occurrence** — one whose context the type has no `RepresentationMap` for — is silently dropped from the copy.\n\n**Steps to reproduce**\n1. Create an `IfcFurniture` type with a `Model/Body/MODEL_VIEW` (and `Model/Box/MODEL_VIEW`) representation.\n2. Assign an occurrence to it, then add an occurrence-specific `Model/Body/PLAN_VIEW` representation to that occurrence.\n3. Duplicate the occurrence.\n\n**Expected:** the copy keeps `Body/MODEL_VIEW`, `Box/MODEL_VIEW`, **and** `Body/PLAN_VIEW`.\n**Actual:** the copy has only the type-mapped `Body/MODEL_VIEW` + `Box/MODEL_VIEW`; the occurrence-local `Body/PLAN_VIEW` is gone.\n\n## Root cause\n\n`core.root.copy_class` takes the type branch and calls `type.map_type_representations`, which **removes all of the occurrence's representations and re-maps only the type's** `RepresentationMaps`. Any occurrence-local representation in a context the type doesn't provide is discarded. (The no-type branch, `copy_representation`, copies everything, hence the asymmetry.)\n\n## Why this is a bug, not misuse\n\nPer IFC4 ADD2 TC1, an occurrence **may** carry representations the type has no map for — `IfcProduct.Representation` is its own attribute, and no WHERE rule ties occurrence representations to the type (the `IfcMappedItem` mapping is convention, not a constraint). So an occurrence-local `PLAN_VIEW` is spec-valid and should survive a copy.\n\n## Feature requests (related)\n\nBeyond fixing the copy, this surfaces a few gaps in working with occurrence-local vs type-mapped representations:\n\n1. **Preserve occurrence-local representations on duplicate** (the fix above).\n2. **Representations panel: distinguish type-inherited vs occurrence-local reps.** Today the only hint is a cryptic `*` suffix. Group rows under **Type** (mapped/inherited) and **Occurrence** (local) headers.\n3. **\"Promote to Type\" action** on an occurrence-local rep: move it onto the type so occurrences inherit it, consolidating other occurrences that carry an *identical* local rep while leaving divergent overrides untouched.\n4. **\"Add to Occurrence\" toggle** on Add Representation (default off): by default a rep added to a typed occurrence lands on the type; the toggle forces a local occurrence override instead.\n\nA PR implementing all four is in progress.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-07-19T21:22:49Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/8788"}
| 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:224efe6d-b387-8c51-cd90-2a1fa1d4eab6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA30:321110:93DCEC:CEB4B5:6B048359 |
| html-safe-nonce | 1e425f7dee5c6a6c8b6d86afad047c2ada98464946c8a57690726a8bf6bed091 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTMwOjMyMTExMDo5M0RDRUM6Q0VCNEI1OjZCMDQ4MzU5IiwidmlzaXRvcl9pZCI6IjY1MjU1OTk3NjAyOTkzNjExMTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e85ca146522279d824cca8778cb28f3cac61edd352b957ae1d2e0a65c113eef1 |
| hovercard-subject-tag | issue:4924436532 |
| 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/8788/issue_layout |
| twitter:image | https://opengraph.githubassets.com/57542f9bb3da92a4de9cbac845a734eddd9dfd2a0c7f48a7bd852285e2d605ed/IfcOpenShell/IfcOpenShell/issues/8788 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/57542f9bb3da92a4de9cbac845a734eddd9dfd2a0c7f48a7bd852285e2d605ed/IfcOpenShell/IfcOpenShell/issues/8788 |
| og:image:alt | Problem When you duplicate (Shift+D) an occurrence that is connected to a type, any representation that lives only on the occurrence — one whose context the type has no RepresentationMap for — is s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theoryshaw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70 |
| 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 | f5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8 |
| 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