Title: Bonsai: a web API for tools that display and edit sheets without building them · Issue #9554 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: a web API for tools that display and edit sheets without building them · Issue #9554 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: a web API for tools that display and edit sheets without building them · Issue #9554 · IfcOpenShell/IfcOpenShell
Description: The gap Bonsai renders a sheet by compositing its layout into one SVG (SheetBuilder.build). That is the right artefact for issuing a drawing set, but a poor one for a tool that displays sheets continuously — a review or redlining tool, s...
Open Graph Description: The gap Bonsai renders a sheet by compositing its layout into one SVG (SheetBuilder.build). That is the right artefact for issuing a drawing set, but a poor one for a tool that displays sheets cont...
X Description: The gap Bonsai renders a sheet by compositing its layout into one SVG (SheetBuilder.build). That is the right artefact for issuing a drawing set, but a poor one for a tool that displays sheets cont...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9554
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: a web API for tools that display and edit sheets without building them","articleBody":"### The gap\n\nBonsai renders a sheet by compositing its layout into one SVG (`SheetBuilder.build`). That is the right artefact for issuing a drawing set, but a poor one for a tool that *displays* sheets continuously — a review or redlining tool, say:\n\n- the built sheet is a rasterised composite, often megabytes, regenerated wholesale on every change;\n- nothing in it says which drawing a mark sits over, so an annotation cannot be anchored to the model.\n\nThe layout is the better source. It is a few KB of structure and links, it carries each drawing's GlobalId in `data-drawing`, and another tool can render it directly. What it cannot do by itself is fill in the templates — `{{Name}}`, `{{Identification}}`, `{{Scale}}`, and a titleblock's fields all come from the model, and a tool reading the saved `.ifc` sees neither unsaved edits nor a model that has never been saved.\n\n### What such a tool needs from Bonsai\n\n**1. Read the values a build would fill in, without building.** From the model in memory, so unsaved edits are included, and from the same methods `build()` uses so the two cannot drift.\n\n**2. Write them back through Bonsai, not into the IFC.** Blender holds the model in memory: a write to the file is invisible to it and lost on its next save. Several of these fields are also more than an attribute — renaming a sheet moves its layout and its built sheet, renaming a drawing moves its SVG and relinks every layout that places it. Only Bonsai does that. Which fields can be written, and why not when they cannot (a scale comes from the drawing's camera; revisions come from the repository's tags), is likewise Bonsai's to answer — a tool deciding for itself would drift from what Bonsai accepts.\n\n**3. A connection that is there when asked.** The web server exists for pages a person opens; a tool reading continuously needs it up without a browser having been opened first, and needs it to survive a project load.\n\n### Proposed\n\nThree requests on the existing `sourcePage: \"sheets\"` web operator:\n\n- `getTemplateValues` — every sheet's titleblock data and each placed drawing's or document's view-title data. Sheets keyed by their layout's path, placements by the file they place, drawings also by GlobalId — never by the layout's `data-id`, which is a STEP id and does not survive a re-serialised model (#9468).\n- `getEditableFields` — for the placeholders a template actually uses, what each holds and whether Bonsai can write it, with a reason when it cannot.\n- `setTemplateValue` — applies values through Bonsai's own operations (`rename_sheet`, `update_drawing_name`, `rename_reference`, `document.edit_information`), and answers with the layout's path afterwards, since renaming a sheet moves it.\n\nAlong with the reliability work that turned out to be needed for any of it to be usable: connection state read from the client rather than the scene (loading a project calls `wm.read_homefile`, which replaced it), a persistent request timer that survives a file load, no second client or second server on reconnect, one failing request no longer unregistering the timer, dead entries pruned from `running_pid.json`, and an opt-in *Keep Web Connection* preference so a tool does not depend on someone having opened a web page.\n\n### Context\n\nThis is implemented and in daily use in [SketchSpace](https://github.com/OpeningDesign/SketchSpace), a self-hosted multi-page whiteboard for redlining drawing sets. It renders Bonsai layouts live, writes drawing positions back into the layout, and now lets view-title and titleblock values be edited from the sheet — every edit going to Bonsai rather than to the file.\n\nNothing proposed here is specific to that tool: it is a read/write API for sheet template values, useful to anything that shows a drawing set without building it.\n\nA PR follows.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-09-20T21:07:38Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9554"}
| 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:4127f6da-ed63-76b0-6e28-df784f663b3c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91CC:96A74:E91AA:137AC6:6B04B06C |
| html-safe-nonce | 892bfb70b50b4bede29611fb3157e7ed6b1dfc9ef2ad55fc2c12cf48db8622d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUNDOjk2QTc0OkU5MUFBOjEzN0FDNjo2QjA0QjA2QyIsInZpc2l0b3JfaWQiOiIyMzM2Nzg4ODQ3Mzc3Mjk3NTE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dc56dfbdad91f2818d8c95a78c2067ad0e62bba6f504a7efc70bee8f7646f291 |
| hovercard-subject-tag | issue:5520482932 |
| 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/9554/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d46c1b2c58ebb30f73eac6222fc092e4e6ae0cba111a6b5f611a2c0fefb5e69b/IfcOpenShell/IfcOpenShell/issues/9554 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d46c1b2c58ebb30f73eac6222fc092e4e6ae0cba111a6b5f611a2c0fefb5e69b/IfcOpenShell/IfcOpenShell/issues/9554 |
| og:image:alt | The gap Bonsai renders a sheet by compositing its layout into one SVG (SheetBuilder.build). That is the right artefact for issuing a drawing set, but a poor one for a tool that displays sheets cont... |
| 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