Title: Bonsai: renaming a sheet or drawing without saving leaves the model pointing at files that no longer exist · Issue #9556 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: renaming a sheet or drawing without saving leaves the model pointing at files that no longer exist · Issue #9556 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: renaming a sheet or drawing without saving leaves the model pointing at files that no longer exist · Issue #9556 · IfcOpenShell/IfcOpenShell
Description: Renaming a sheet or a drawing moves files on disk immediately, but the new names reach the IFC only when the model is saved. Close without saving, reopen, and the model names files that are no longer there. To reproduce Open a project wi...
Open Graph Description: Renaming a sheet or a drawing moves files on disk immediately, but the new names reach the IFC only when the model is saved. Close without saving, reopen, and the model names files that are no long...
X Description: Renaming a sheet or a drawing moves files on disk immediately, but the new names reach the IFC only when the model is saved. Close without saving, reopen, and the model names files that are no long...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9556
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: renaming a sheet or drawing without saving leaves the model pointing at files that no longer exist","articleBody":"Renaming a sheet or a drawing moves files on disk immediately, but the new names reach the IFC only when the model is saved. Close without saving, reopen, and the model names files that are no longer there.\n\n### To reproduce\n\n1. Open a project with a sheet that has a drawing on it.\n2. Rename the sheet (or the drawing) in the Drawings panel. Its layout and built sheet are moved on disk at once; a renamed drawing's SVG is moved too, and every layout placing it is relinked.\n3. Close Blender **without saving the IFC**.\n4. Reopen the model and run **Open Layout** on that sheet.\n\n**Expected:** the layout opens, or Bonsai says what is wrong.\n\n**Actual:** `FileNotFoundError` out of the operator (paths shortened):\n\n```\n File \".../bonsai/bim/ifc.py\", line 569, in execute_ifc_operator\n result = getattr(operator, \"_execute\")(context)\n File \".../bonsai/bim/module/drawing/operator.py\", line 3056, in _execute\n sheet_builder.update_sheet_drawing_sizes(sheet)\n File \".../bonsai/bim/module/drawing/sheeter.py\", line 211, in update_sheet_drawing_sizes\n layout_tree = ET.parse(layout_path)\n ...\n File \".../python/Lib/xml/etree/ElementTree.py\", line 562, in parse\n source = open(source, \"rb\")\nFileNotFoundError: [Errno 2] No such file or directory:\n '...\\\\layouts\\\\A01 - PLANS SECTIONS AND ELEVTIONS.svg'\n```\n\n**Create Sheets** reaches the same state more quietly: `validate_sheet_files` finds the layout missing and the sheet is skipped, so a sheet that looks fine in the UI is simply not built.\n\nSeen on Blender 5.2.1, IFC4, on a `v0.8.0`-era build; the code involved is unchanged on `v0.9.0`.\n\n### Why it happens\n\nThe rename is applied in two places that do not commit together:\n\n- **On disk, immediately** — `core.rename_sheet` moves the layout and the built sheet; `core.update_drawing_name` moves the drawing's SVG and rewrites the link in every layout that places it.\n- **In the IFC, only on save** — the `IfcDocumentReference` locations are changed in memory.\n\nSo an unsaved session leaves the files under their new names and the saved model under the old ones. Nothing is lost — the work is all still on disk — but the model cannot find any of it, and nothing says which file is which.\n\nIt is easy to hit, because renaming sheets is a tidying-up activity and tidying up is exactly when someone closes without saving.\n\n### Suggested direction\n\nThe model in front of you is the authority on what its sheets are called, and Bonsai already names a sheet's files after it. So the files can be put back under the names the open model uses, and the person told that it happened — rename again and save to keep a new name.\n\nThe matching has to be careful, since it moves files. A candidate is an `.svg` in the same folder that no sheet refers to and that demonstrably belongs to this sheet: it places exactly that sheet's drawings, or carries the sheet's number and shares a drawing with it. Only an unambiguous match should be moved, and nothing another sheet or drawing still expects. A drawing's moved file can be found through the layout, which still ties each drawing's GlobalId to the file it was moved to.\n\nFailing all that, `bim.open_layout` should report a missing layout rather than raise.\n\nA PR follows.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-09-20T21:28:36Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9556"}
| 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:9cb78bb2-5e42-47ff-2161-19a5b5d964c6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C540:3B5A9F:52F4:6D7C:6B04AD4C |
| html-safe-nonce | 84af5950074e9ab9609729e41b22568ab8921d15e12ada541ae41092b2a468fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTQwOjNCNUE5Rjo1MkY0OjZEN0M6NkIwNEFENEMiLCJ2aXNpdG9yX2lkIjoiMzY1NTA4Mjk2OTU5MDQ0MzM0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f8c05633ffb0075d7f9329cbbe20c27113146d07214ae7dbd95bb59a1860fa71 |
| hovercard-subject-tag | issue:5520584067 |
| 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/9556/issue_layout |
| twitter:image | https://opengraph.githubassets.com/da6d5c5a5ae37738321acf2abfbcc6aae8073546e816dbed9e9fafe621e95935/IfcOpenShell/IfcOpenShell/issues/9556 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/da6d5c5a5ae37738321acf2abfbcc6aae8073546e816dbed9e9fafe621e95935/IfcOpenShell/IfcOpenShell/issues/9556 |
| og:image:alt | Renaming a sheet or a drawing moves files on disk immediately, but the new names reach the IFC only when the model is saved. Close without saving, reopen, and the model names files that are no long... |
| 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 | 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