Tweaked UI for Linked Aggregates https://imgur.com/a/rExISKO

This commit is contained in:
Ryan Schultz
2024-04-28 10:34:52 -05:00
parent f857c513c5
commit 4b56b34124
2 changed files with 23 additions and 14 deletions
@@ -20,6 +20,7 @@ from bpy.types import Panel
from blenderbim.bim.module.aggregate.data import AggregateData from blenderbim.bim.module.aggregate.data import AggregateData
from blenderbim.bim.module.group.data import GroupsData, ObjectGroupsData from blenderbim.bim.module.group.data import GroupsData, ObjectGroupsData
from blenderbim.bim.ifc import IfcStore from blenderbim.bim.ifc import IfcStore
import blenderbim.tool as tool
class BIM_PT_aggregate(Panel): class BIM_PT_aggregate(Panel):
@@ -131,14 +132,21 @@ class BIM_PT_linked_aggregate(Panel):
if not AggregateData.is_loaded: if not AggregateData.is_loaded:
AggregateData.load() AggregateData.load()
props = context.active_object.BIMObjectAggregateProperties obj = context.active_object
row = layout.row(align=True) element = tool.Ifc.get_entity(obj)
row.label(text="Advanced Users Only", icon="ERROR") props = obj.BIMObjectAggregateProperties
row = layout.row(align=True) row = layout.row(align=True)
if type(AggregateData.data['total_linked_aggregate']) is int:
if AggregateData.data['total_linked_aggregate'] > 0: if element.Decomposes:
row.label(text=f"{AggregateData.data['total_linked_aggregate']} Linked Aggregates") Number_Linked_Aggregates = AggregateData.data['total_linked_aggregate']
if not Number_Linked_Aggregates:
row.label(text="Not a Linked Aggregate")
else:
row.label(text=f"{Number_Linked_Aggregates} Linked Aggregates")
op = row.operator("bim.object_duplicate_move_linked_aggregate_macro", text="", icon="DUPLICATE")
if type(Number_Linked_Aggregates) is int:
if Number_Linked_Aggregates > 0:
op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_DATA_POINTCLOUD") op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_DATA_POINTCLOUD")
op.select_parts = False op.select_parts = False
op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_OB_POINTCLOUD") op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_OB_POINTCLOUD")
@@ -146,7 +154,7 @@ class BIM_PT_linked_aggregate(Panel):
row.operator("bim.refresh_linked_aggregate", text="", icon="FILE_REFRESH") row.operator("bim.refresh_linked_aggregate", text="", icon="FILE_REFRESH")
op = row.operator("bim.break_link_to_other_aggregates", text="", icon="X") op = row.operator("bim.break_link_to_other_aggregates", text="", icon="X")
else: else:
row.label(text="No Linked Aggregates") row.label(text="Not an Aggregate")
@@ -940,6 +940,7 @@ class OverrideDuplicateMoveLinked(bpy.types.Operator):
class DuplicateMoveLinkedAggregateMacro(bpy.types.Macro): class DuplicateMoveLinkedAggregateMacro(bpy.types.Macro):
bl_description = "Create a new linked aggregate"
bl_idname = "bim.object_duplicate_move_linked_aggregate_macro" bl_idname = "bim.object_duplicate_move_linked_aggregate_macro"
bl_label = "IFC Duplicate Linked Aggregate" bl_label = "IFC Duplicate Linked Aggregate"
bl_options = {"REGISTER", "UNDO"} bl_options = {"REGISTER", "UNDO"}