Title: Error when trying to bim.append_library_element · Issue #7261 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Error when trying to bim.append_library_element · Issue #7261 · IfcOpenShell/IfcOpenShell
X Title: Error when trying to bim.append_library_element · Issue #7261 · IfcOpenShell/IfcOpenShell
Description: Bug Description When I try to bim.append_library_element L1 IfcLightFixture from the following file, i get the following error. I thought this was related to this so i ran that script, but that didn't seem to clean it up. It's also proba...
Open Graph Description: Bug Description When I try to bim.append_library_element L1 IfcLightFixture from the following file, i get the following error. I thought this was related to this so i ran that script, but that did...
X Description: Bug Description When I try to bim.append_library_element L1 IfcLightFixture from the following file, i get the following error. I thought this was related to this so i ran that script, but that did...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/7261
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when trying to bim.append_library_element","articleBody":"### Bug Description\n\nWhen I try to bim.append_library_element `L1` IfcLightFixture from the following file, i get the following error. \n\nI thought this was related to [this](https://github.com/IfcOpenShell/IfcOpenShell/issues/7083#issuecomment-3253495862) so i ran that script, but that didn't seem to clean it up. \n\nIt's also probably related to: https://github.com/IfcOpenShell/IfcOpenShell/issues/6972\n\nfile: https://hub.openingdesign.com/OpeningDesign/Restaurant_Brookfield/src/commit/4e4de33f234c622da795685db07848331c5b5f8c/Open/Models/Bonsai/Restaurant_Brookfield.ifc\n\n...\nwondering if there's anyway to clean this file up. \n\n\n\n### Attachments\n\n_No response_\n\n### Debug and Error Output\n\n```true\nos: Windows\nos_version: 10.0.19045\npython_version: 3.11.11\narchitecture: ('64bit', 'WindowsPE')\nmachine: AMD64\nprocessor: Intel64 Family 6 Model 158 Stepping 10, GenuineIntel\nblender_version: 4.5.2 LTS\nbonsai_version: 0.0.0\nbonsai_commit_hash: f52aafd\nbonsai_commit_date: 2025-10-14T21:53:22-05:00\nlast_actions: \n# ifcopenshell.api: owner.create_owner_history\n>>> {}\n# ifcopenshell.api: geometry.edit_object_placement\n>>> {\"product\": {\"cast_type\": \"entity_instance\", \"value\": 52, \"Name\": \"My Storey\"}, \"matrix\": {\"cast_type\": \"ndarray\", \"value\": [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]}}\n# ifcopenshell.api: owner.update_owner_history\n>>> {\"element\": {\"cast_type\": \"entity_instance\", \"value\": 52, \"Name\": \"My Storey\"}}\n# ifcopenshell.api: aggregate.assign_object\n>>> {\"products\": [{\"cast_type\": \"entity_instance\", \"value\": 40, \"Name\": \"My Site\"}], \"relating_object\": {\"cast_type\": \"entity_instance\", \"value\": 1, \"Name\": \"My Project\"}}\n# ifcopenshell.api: spatial.unassign_container\n>>> {\"products\": \"[]\"}\n# ifcopenshell.api: owner.create_owner_history\n>>> {}\n# ifcopenshell.api: geometry.edit_object_placement\n>>> {\"product\": {\"cast_type\": \"entity_instance\", \"value\": 40, \"Name\": \"My Site\"}, \"matrix\": {\"cast_type\": \"ndarray\", \"value\": [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]}, \"is_si\": \"False\"}\n# ifcopenshell.api: owner.update_owner_history\n>>> {\"element\": {\"cast_type\": \"entity_instance\", \"value\": 40, \"Name\": \"My Site\"}}\n# ifcopenshell.api: aggregate.assign_object\n>>> {\"products\": [{\"cast_type\": \"entity_instance\", \"value\": 46, \"Name\": \"My Building\"}], \"relating_object\": {\"cast_type\": \"entity_instance\", \"value\": 40, \"Name\": \"My Site\"}}\n# ifcopenshell.api: spatial.unassign_container\n>>> {\"products\": \"[]\"}\n# ifcopenshell.api: owner.create_owner_history\n>>> {}\n# ifcopenshell.api: geometry.edit_object_placement\n>>> {\"product\": {\"cast_type\": \"entity_instance\", \"value\": 46, \"Name\": \"My Building\"}, \"matrix\": {\"cast_type\": \"ndarray\", \"value\": [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]}, \"is_si\": \"False\"}\n# ifcopenshell.api: owner.update_owner_history\n>>> {\"element\": {\"cast_type\": \"entity_instance\", \"value\": 46, \"Name\": \"My Building\"}}\n# ifcopenshell.api: aggregate.assign_object\n>>> {\"products\": [{\"cast_type\": \"entity_instance\", \"value\": 52, \"Name\": \"My Storey\"}], \"relating_object\": {\"cast_type\": \"entity_instance\", \"value\": 46, \"Name\": \"My Building\"}}\n# ifcopenshell.api: spatial.unassign_container\n>>> {\"products\": \"[]\"}\n# ifcopenshell.api: owner.create_owner_history\n>>> {}\n# ifcopenshell.api: geometry.edit_object_placement\n>>> {\"product\": {\"cast_type\": \"entity_instance\", \"value\": 52, \"Name\": \"My Storey\"}, \"matrix\": {\"cast_type\": \"ndarray\", \"value\": [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]}, \"is_si\": \"False\"}\n# ifcopenshell.api: owner.update_owner_history\n>>> {\"element\": {\"cast_type\": \"entity_instance\", \"value\": 52, \"Name\": \"My Storey\"}}\n# operator: BIM_OT_append_library_element\n# ifcopenshell.api: project.append_asset\n>>> {\"library\": \"\u003cifcopenshell.file.file object at 0x00000242227E8350>\", \"element\": {\"cast_type\": \"entity_instance\", \"value\": 4788321, \"Name\": \"L1\"}, \"assume_asset_uniqueness_by_name\": \"True\"}\nlast_error: Traceback (most recent call last):\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\bim\\ifc.py\", line 526, in execute_ifc_operator\n result = getattr(operator, \"_execute\")(context)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\bim\\module\\project\\operator.py\", line 605, in _execute\n element = ifcopenshell.api.project.append_asset(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\__init__.py\", line 275, in wrapper\n result = usecase(*args, **settings)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 143, in append_asset\n return usecase.execute()\n ^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 222, in execute\n return self.append_type_product()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 333, in append_type_product\n element = self.add_element(self.settings[\"element\"])\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 392, in add_element\n self.check_inverses(element)\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 437, in check_inverses\n self.add_inverse_element(inverse)\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 485, in add_inverse_element\n new_attribute = self.add_element(attribute)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 400, in add_element\n self.check_inverses(subelement)\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 437, in check_inverses\n self.add_inverse_element(inverse)\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 496, in add_inverse_element\n item = self.add_element(item)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 390, in add_element\n new = self.file_add(element)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 745, in file_add\n attr_value = apply_to_array(attr_value, file_add_)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 726, in apply_to_array\n return tuple(apply_to_array(sub, func) for sub in arr)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 726, in \u003cgenexpr>\n return tuple(apply_to_array(sub, func) for sub in arr)\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 727, in apply_to_array\n return func(arr)\n ^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 745, in file_add\n attr_value = apply_to_array(attr_value, file_add_)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 726, in apply_to_array\n return tuple(apply_to_array(sub, func) for sub in arr)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 726, in \u003cgenexpr>\n return tuple(apply_to_array(sub, func) for sub in arr)\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 727, in apply_to_array\n return func(arr)\n ^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 743, in file_add\n tuple_type = get_tuple_type(attr_value)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\ifcopenshell\\api\\project\\append_asset.py\", line 718, in get_tuple_type\n tuple_ = tuple_[0]\n ~~~~~~^^^\nIndexError: tuple index out of range\n\nifc: Unsaved\nschema: IFC4\npreprocessor_version: IfcOpenShell 0.0.0\noriginating_system: IfcOpenShell 0.0.0\n```","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2025-10-16T22:34:49Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/7261"}
| 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:21044919-f4a0-a011-fa82-7d9aa2c1ac77 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA98:1453CC:6CEA3D:950670:6B0477A9 |
| html-safe-nonce | 895ae5a0f0aa29444ce99d2c748f4a3119fa231ad6d7387e739bf90063c20ee8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTk4OjE0NTNDQzo2Q0VBM0Q6OTUwNjcwOjZCMDQ3N0E5IiwidmlzaXRvcl9pZCI6IjU4OTUyODEzNzIyMzQ1NDUwNjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 18a7131ce1d9c925f4a270913c20d34ea15c56a8f4974fe1734eafa74a9c0d9a |
| hovercard-subject-tag | issue:3523721145 |
| 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/7261/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0fab13a620cfc4ea58ed3b8c95c1de6e02a8c41bb78201f1b1479127c93e8f9d/IfcOpenShell/IfcOpenShell/issues/7261 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0fab13a620cfc4ea58ed3b8c95c1de6e02a8c41bb78201f1b1479127c93e8f9d/IfcOpenShell/IfcOpenShell/issues/7261 |
| og:image:alt | Bug Description When I try to bim.append_library_element L1 IfcLightFixture from the following file, i get the following error. I thought this was related to this so i ran that script, but that did... |
| 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 | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| 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 | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| 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