mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
@@ -833,9 +833,7 @@ class CreateDrawing(bpy.types.Operator):
|
||||
files = {bim_props.ifc_file: tool.Ifc.get()}
|
||||
|
||||
props = tool.Project.get_project_props()
|
||||
for link in props.links:
|
||||
if not link.is_loaded:
|
||||
continue
|
||||
for link in props.get_loaded_links():
|
||||
files[link.name] = self.get_linked_file(link)
|
||||
|
||||
target_view = ifcopenshell.util.element.get_psets(self.camera_element)["EPset_Drawing"]["TargetView"]
|
||||
@@ -1257,7 +1255,7 @@ class CreateDrawing(bpy.types.Operator):
|
||||
return tool.Ifc.get().by_guid(guid)
|
||||
except RuntimeError:
|
||||
props = tool.Project.get_project_props()
|
||||
for link in props.links:
|
||||
for link in props.get_loaded_links():
|
||||
ifc_file = self.get_linked_file(link)
|
||||
try:
|
||||
return ifc_file.by_guid(guid)
|
||||
@@ -1273,7 +1271,7 @@ class CreateDrawing(bpy.types.Operator):
|
||||
return tool.Ifc.get().by_id(step_id)
|
||||
except RuntimeError:
|
||||
props = tool.Project.get_project_props()
|
||||
for link in props.links:
|
||||
for link in props.get_loaded_links():
|
||||
ifc_file = self.get_linked_file(link)
|
||||
try:
|
||||
return ifc_file.by_id(step_id)
|
||||
|
||||
@@ -35,7 +35,7 @@ from bpy.props import (
|
||||
IntProperty,
|
||||
StringProperty,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Literal, Union, get_args
|
||||
from typing import TYPE_CHECKING, Literal, Union, get_args, Generator
|
||||
from typing_extensions import assert_never
|
||||
|
||||
|
||||
@@ -500,6 +500,12 @@ class BIMProjectProperties(PropertyGroup):
|
||||
return self.library_breadcrumb[-1]
|
||||
return None
|
||||
|
||||
def get_loaded_links(self) -> Generator[Link, None, None]:
|
||||
for link in self.links:
|
||||
if not link.is_loaded:
|
||||
continue
|
||||
yield link
|
||||
|
||||
|
||||
class MeasureToolSettings(PropertyGroup):
|
||||
measurement_type_items = [
|
||||
|
||||
Reference in New Issue
Block a user