mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Skip loading linked models in the drawing if they're unloaded #6403
As it's probably unintuitive (user can't see the linked model in viewport but we still load it) and user then have no option to keep model in Links but keep it unloaded.
Also producing traceback below if linked file is missing.
```
Error: Python: Traceback (most recent call last):
File "\bonsai\bim\module\drawing\operator.py", line 299, in execute
linework_svg = self.generate_linework(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\module\drawing\operator.py", line 828, in generate_linework
IfcStore.session_files[link.name] = ifcopenshell.open(link.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\__init__.py", line 162, in open
raise FileNotFoundError(f"File does not exist: '{path}'.")
FileNotFoundError: File does not exist: 'D:\Dropbox\GitLab\OD_Library\BIM\OD_Revit_Template - 2020 - IFC4 - Reference View.ifc'.
```
This commit is contained in:
@@ -824,6 +824,8 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
|
|
||||||
props = tool.Project.get_project_props()
|
props = tool.Project.get_project_props()
|
||||||
for link in props.links:
|
for link in props.links:
|
||||||
|
if not link.is_loaded:
|
||||||
|
continue
|
||||||
if link.name not in IfcStore.session_files:
|
if link.name not in IfcStore.session_files:
|
||||||
IfcStore.session_files[link.name] = ifcopenshell.open(link.name)
|
IfcStore.session_files[link.name] = ifcopenshell.open(link.name)
|
||||||
files[link.name] = IfcStore.session_files[link.name]
|
files[link.name] = IfcStore.session_files[link.name]
|
||||||
|
|||||||
Reference in New Issue
Block a user