Title: Improve speed of `bim.activate_drawing` · Issue #9014 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Improve speed of `bim.activate_drawing` · Issue #9014 · IfcOpenShell/IfcOpenShell
X Title: Improve speed of `bim.activate_drawing` · Issue #9014 · IfcOpenShell/IfcOpenShell
Description: bim.activate_drawing is slow to run on larger models, sometimes taking many seconds (or longer) before the drawing view becomes usable. This is closely related to #5696 (Improved speed of bim.activate_model command) since both operators ...
Open Graph Description: bim.activate_drawing is slow to run on larger models, sometimes taking many seconds (or longer) before the drawing view becomes usable. This is closely related to #5696 (Improved speed of bim.activ...
X Description: bim.activate_drawing is slow to run on larger models, sometimes taking many seconds (or longer) before the drawing view becomes usable. This is closely related to #5696 (Improved speed of bim.activ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9014
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve speed of `bim.activate_drawing`","articleBody":"`bim.activate_drawing` is slow to run on larger models, sometimes taking many seconds (or longer) before the drawing view becomes usable. This is closely related to #5696 (*Improved speed of `bim.activate_model` command*) since both operators end up doing per-element geometry work, but it's worth tracking separately because activating a drawing does additional drawing-specific work on top.\n\n**Where the time appears to go** (from a read of the current `v0.8.0` code):\n\n1. **Per-element representation switching** — `tool.Drawing.activate_drawing` loops over every element in the drawing (`get_drawing_elements | get_drawing_spaces`) and calls `core.geometry.switch_representation` for each one to move it into the drawing's subcontext (e.g. plan/section body). On a large model this is essentially the same expensive geometry re-import that makes `bim.activate_model` slow (#5696).\n2. **Annotation import** — `import_annotations_in_group` for the drawing group.\n3. **Visibility isolation** — a full pass over `bpy.context.view_layer.objects` to build the visible set, plus `isolate_objects`.\n4. **Reference sync + decorations** — `sync_references`, `reload_drawing_styles`, `activate_drawing_style`, cut decorator install, and `show_decorations` in the operator.\n\n**Possible directions** (not committed to any):\n- Skip re-switching representations for elements already showing the correct subcontext representation (a fast-path check already exists partially — it `break`s when the active representation matches — but the loop still iterates every element and re-queries).\n- Reuse / share the caching or `skip_list`-style approach being explored for `bim.activate_model` in #5696, since the underlying `switch_representation` cost is shared.\n- Profile the annotation import and `sync_references` steps to see how much they contribute vs. geometry switching.\n\n**Benchmark models** (same ones used in #5696):\n- Monster: Highland_Haven — https://hub.openingdesign.com/OpeningDesign/Highland_Haven/src/commit/a4079de8fdc2f10b2d95bbb61542fe560a83b143/Open/Models_and_CAD/BlenderBIM/Highland_Haven.ifc\n- More reasonable: Verona_3_Season_Porch — https://hub.openingdesign.com/OpeningDesign/Verona_3_Season_Porch/src/commit/53e2affc7d78ea9f403278f77744b64096304b72/Open/Models/BlenderBIM/Verona_3_Season_Porch.ifc\n\nRelated: #5696\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-07-27T18:16:44Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9014"}
| 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:041fc5ec-3e6c-88ee-0007-122c83c5da37 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B9BC:367411:97C36A:CF5410:6B048158 |
| html-safe-nonce | 8d4aedb01e65d8e04f5fa067b687941bee6ea86865887c5bbd553046f4537fd9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUJDOjM2NzQxMTo5N0MzNkE6Q0Y1NDEwOjZCMDQ4MTU4IiwidmlzaXRvcl9pZCI6IjkwOTI3ODQxODkzNzU1NDU2ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0af3a857c2f7efd17f33d6c52186672c94ee3cc2fe89c8ea1815ae1d47884b3c |
| hovercard-subject-tag | issue:4990987114 |
| 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/9014/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0c3ba2bfd6d57113c9daf136cec0d965c685a758a59073d50fb1d59dd7977013/IfcOpenShell/IfcOpenShell/issues/9014 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0c3ba2bfd6d57113c9daf136cec0d965c685a758a59073d50fb1d59dd7977013/IfcOpenShell/IfcOpenShell/issues/9014 |
| og:image:alt | bim.activate_drawing is slow to run on larger models, sometimes taking many seconds (or longer) before the drawing view becomes usable. This is closely related to #5696 (Improved speed of bim.activ... |
| 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 | 0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511 |
| 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 | ed3f2e01f6b7672780c586c8af0e72726374d7b6 |
| 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