Title: Create Drawing fails if the configured SVG viewer command can't be launched · Issue #10197 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Create Drawing fails if the configured SVG viewer command can't be launched · Issue #10197 · IfcOpenShell/IfcOpenShell
X Title: Create Drawing fails if the configured SVG viewer command can't be launched · Issue #10197 · IfcOpenShell/IfcOpenShell
Description: Describe the bug If svg_command (or pdf_command / spreadsheet_command / layout_svg_command) in the Bonsai preferences points to a program that doesn't exist, bim.create_drawing with "open in viewer" enabled raises FileNotFoundError and t...
Open Graph Description: Describe the bug If svg_command (or pdf_command / spreadsheet_command / layout_svg_command) in the Bonsai preferences points to a program that doesn't exist, bim.create_drawing with "open in viewer...
X Description: Describe the bug If svg_command (or pdf_command / spreadsheet_command / layout_svg_command) in the Bonsai preferences points to a program that doesn't exist, bim.create_drawing with "open ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/10197
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Create Drawing fails if the configured SVG viewer command can't be launched","articleBody":"**Describe the bug**\n\nIf `svg_command` (or `pdf_command` / `spreadsheet_command` / `layout_svg_command`) in the Bonsai preferences points to a program that doesn't exist, `bim.create_drawing` with \"open in viewer\" enabled raises `FileNotFoundError` and the operator fails. But by then the drawing SVG has already been written, so the drawing reports as failed even though it was created.\n\nThis is also confusing to debug: `bim.debug_active_drawing` runs `create_drawing` without `open_viewer`, so it reports \"No errors creating drawing\" and doesn't find anything.\n\n**To reproduce**\n\n1. In Bonsai preferences, set the SVG command to a path that doesn't exist, e.g. `[[\"C:/Program Files/Mozilla Firefox/firefox.exe\", \"path\"]]` on a machine without Firefox.\n2. Activate any drawing and run Create Drawing with Ctrl+click (`open_viewer=True`).\n3. The drawing generates fully, then the operator fails:\n\n```\n File \".../bonsai/bim/module/drawing/operator.py\", line 487, in execute\n tool.Drawing.open_with_user_command(tool.Blender.get_addon_preferences().svg_command, drawing_uri)\n File \".../bonsai/tool/drawing.py\", line 1325, in open_with_user_command\n subprocess.Popen([replacements.get(c, c) for c in command])\n ...\nFileNotFoundError: [WinError 2] The system cannot find the file specified\n```\n\n**Expected behaviour**\n\nThe drawing is created. Bonsai shows a warning that the viewer couldn't be launched and that the viewer command in the preferences should be checked.\n\n**Proposed fix**\n\nCatch `OSError` in `tool.Drawing.open_with_user_command` and report it, instead of letting it propagate. That function is shared, so this covers drawings, sheets, schedules, references and layouts. I have a branch ready for this.\n\n**Environment**\n\n- Bonsai v0.9.0 branch, Blender 5.1.2, Windows 11\n\n**Related:** #7333 (a different failure in the same function, a malformed command causing `JSONDecodeError`).\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-11-11T21:15:09Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10197"}
| 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:e3b5136e-aa84-e49c-5097-0d371bcd15f0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE0E:E08F0:32487:473FB:6B046156 |
| html-safe-nonce | b2a06cc1c016316094ed4c10309b0e7bb67a275665955f5cd24cfaaa52f77f94 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTBFOkUwOEYwOjMyNDg3OjQ3M0ZCOjZCMDQ2MTU2IiwidmlzaXRvcl9pZCI6IjQ2NDk3OTUzOTI4Njg0MzczNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 57486f14f11bd1c81ecdf3a92bf55853f7c0890b93a31f5bff282a2e0ebc9406 |
| hovercard-subject-tag | issue:6337270569 |
| 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/10197/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fe1aeb8be3e95f6f5845400a6e6eff1992c2c76de857e8f9f61d125c2873a24f/IfcOpenShell/IfcOpenShell/issues/10197 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fe1aeb8be3e95f6f5845400a6e6eff1992c2c76de857e8f9f61d125c2873a24f/IfcOpenShell/IfcOpenShell/issues/10197 |
| og:image:alt | Describe the bug If svg_command (or pdf_command / spreadsheet_command / layout_svg_command) in the Bonsai preferences points to a program that doesn't exist, bim.create_drawing with "open in viewer... |
| 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 | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| 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 | 03e114520787ad27289207f153520ef97461127c |
| 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