This repository was archived by the owner on Nov 24, 2024. It is now read-only.
Commit 53e5884
committed
Reset active drawing id if we removed the active drawing
Previously there was an error if you remove all drawings:
```
Traceback (most recent call last):
File "\addons\blenderbim\bim\module\drawing\ui.py", line 182, in draw
DrawingsData.load()
File "\addons\blenderbim\bim\module\drawing\data.py", line 106, in load
"active_drawing_pset_data": cls.active_drawing_pset_data(),
File "\addons\blenderbim\bim\module\drawing\data.py", line 134, in active_drawing_pset_data
drawing = ifc_file.by_id(bpy.context.scene.DocProperties.active_drawing_id)
File "\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 326, in by_id
return self[id]
File "\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 314, in __getitem__
return entity_instance(self.wrapped_data.by_id(key), self)
File "\addons\blenderbim\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 4517, in by_id
return _ifcopenshell_wrapper.file_by_id(self, id)
RuntimeError: Instance #1 077 not found
```1 parent 9c367d1 commit 53e5884
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1410 | 1410 | | |
1411 | 1411 | | |
1412 | 1412 | | |
| 1413 | + | |
1413 | 1414 | | |
1414 | 1415 | | |
1415 | 1416 | | |
1416 | 1417 | | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
1417 | 1421 | | |
1418 | 1422 | | |
1419 | 1423 | | |
| |||
0 commit comments