mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
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:
@@ -886,7 +886,7 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
files = {bim_props.ifc_file: tool.Ifc.get()}
|
files = {bim_props.ifc_file: tool.Ifc.get()}
|
||||||
|
|
||||||
props = tool.Project.get_project_props()
|
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)
|
files[link.name] = self.get_linked_file(link)
|
||||||
|
|
||||||
target_view = ifcopenshell.util.element.get_psets(self.camera_element)["EPset_Drawing"]["TargetView"]
|
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)
|
return tool.Ifc.get().by_guid(guid)
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
props = tool.Project.get_project_props()
|
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)
|
ifc_file = self.get_linked_file(link)
|
||||||
try:
|
try:
|
||||||
return ifc_file.by_guid(guid)
|
return ifc_file.by_guid(guid)
|
||||||
@@ -1324,7 +1324,7 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
return tool.Ifc.get().by_id(step_id)
|
return tool.Ifc.get().by_id(step_id)
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
props = tool.Project.get_project_props()
|
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)
|
ifc_file = self.get_linked_file(link)
|
||||||
try:
|
try:
|
||||||
return ifc_file.by_id(step_id)
|
return ifc_file.by_id(step_id)
|
||||||
|
|||||||
@@ -409,6 +409,11 @@ class DocProperties(PropertyGroup):
|
|||||||
should_use_annotation_cache: BoolProperty(
|
should_use_annotation_cache: BoolProperty(
|
||||||
name="Use Annotation Cache", description="Global option for all drawings.", default=False
|
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_drawings: BoolProperty(name="Is Editing Drawings", default=False)
|
||||||
is_editing_schedules: BoolProperty(name="Is Editing Schedules", default=False)
|
is_editing_schedules: BoolProperty(name="Is Editing Schedules", default=False)
|
||||||
is_editing_references: BoolProperty(name="Is Editing References", 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_underlay_cache: bool
|
||||||
should_use_linework_cache: bool
|
should_use_linework_cache: bool
|
||||||
should_use_annotation_cache: bool
|
should_use_annotation_cache: bool
|
||||||
|
should_draw_linked_projects: bool
|
||||||
is_editing_drawings: bool
|
is_editing_drawings: bool
|
||||||
is_editing_schedules: bool
|
is_editing_schedules: bool
|
||||||
is_editing_references: bool
|
is_editing_references: bool
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ class BIM_PT_camera(Panel):
|
|||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
row.prop(props, "has_annotation", icon="MOD_EDGESPLIT")
|
row.prop(props, "has_annotation", icon="MOD_EDGESPLIT")
|
||||||
row.prop(dprops, "should_use_annotation_cache", text="", icon="FILE_REFRESH")
|
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 = self.layout.row(align=True)
|
||||||
row.prop(props, "target_view")
|
row.prop(props, "target_view")
|
||||||
|
|||||||
@@ -505,7 +505,10 @@ class BIMProjectProperties(PropertyGroup):
|
|||||||
return self.library_breadcrumb[-1]
|
return self.library_breadcrumb[-1]
|
||||||
return None
|
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:
|
for link in self.links:
|
||||||
if not link.is_loaded:
|
if not link.is_loaded:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user