An option not to print linked ifc files #6947

Location - https://files.catbox.moe/9qinpy.png
This option is also a nice way of showing the user that this feature does exist.
This commit is contained in:
Andrej730
2025-08-11 12:49:37 +05:00
parent f60abdd18f
commit 39f4abe243
4 changed files with 15 additions and 4 deletions
@@ -886,7 +886,7 @@ class CreateDrawing(bpy.types.Operator):
files = {bim_props.ifc_file: tool.Ifc.get()}
props = tool.Project.get_project_props()
for link in props.get_loaded_links():
for link in props.get_loaded_links_for_drawings():
files[link.name] = self.get_linked_file(link)
target_view = ifcopenshell.util.element.get_psets(self.camera_element)["EPset_Drawing"]["TargetView"]
@@ -1308,7 +1308,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.get_loaded_links():
for link in props.get_loaded_links_for_drawings():
ifc_file = self.get_linked_file(link)
try:
return ifc_file.by_guid(guid)
@@ -1324,7 +1324,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.get_loaded_links():
for link in props.get_loaded_links_for_drawings():
ifc_file = self.get_linked_file(link)
try:
return ifc_file.by_id(step_id)
@@ -409,6 +409,11 @@ class DocProperties(PropertyGroup):
should_use_annotation_cache: BoolProperty(
name="Use Annotation Cache", description="Global option for all drawings.", default=False
)
should_draw_linked_projects: BoolProperty(
name="Draw Linked Projects",
description=("Whether to draw all currently loaded linked projects.\n\nGlobal option for all drawings."),
default=True,
)
is_editing_drawings: BoolProperty(name="Is Editing Drawings", default=False)
is_editing_schedules: BoolProperty(name="Is Editing Schedules", default=False)
is_editing_references: BoolProperty(name="Is Editing References", default=False)
@@ -438,6 +443,7 @@ class DocProperties(PropertyGroup):
should_use_underlay_cache: bool
should_use_linework_cache: bool
should_use_annotation_cache: bool
should_draw_linked_projects: bool
is_editing_drawings: bool
is_editing_schedules: bool
is_editing_references: bool
@@ -70,6 +70,8 @@ class BIM_PT_camera(Panel):
row = col.row(align=True)
row.prop(props, "has_annotation", icon="MOD_EDGESPLIT")
row.prop(dprops, "should_use_annotation_cache", text="", icon="FILE_REFRESH")
row = col.row(align=True)
row.prop(dprops, "should_draw_linked_projects")
row = self.layout.row(align=True)
row.prop(props, "target_view")
+4 -1
View File
@@ -505,7 +505,10 @@ class BIMProjectProperties(PropertyGroup):
return self.library_breadcrumb[-1]
return None
def get_loaded_links(self) -> Generator[Link, None, None]:
def get_loaded_links_for_drawings(self) -> Generator[Link]:
props = tool.Drawing.get_document_props()
if not props.should_draw_linked_projects:
return
for link in self.links:
if not link.is_loaded:
continue