mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
Tweaked UI for Linked Aggregates https://imgur.com/a/rExISKO
This commit is contained in:
@@ -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,22 +132,29 @@ 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
|
||||||
|
element = tool.Ifc.get_entity(obj)
|
||||||
|
props = obj.BIMObjectAggregateProperties
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.label(text="Advanced Users Only", icon="ERROR")
|
|
||||||
row = layout.row(align=True)
|
|
||||||
|
if element.Decomposes:
|
||||||
if type(AggregateData.data['total_linked_aggregate']) is int:
|
Number_Linked_Aggregates = AggregateData.data['total_linked_aggregate']
|
||||||
if AggregateData.data['total_linked_aggregate'] > 0:
|
if not Number_Linked_Aggregates:
|
||||||
row.label(text=f"{AggregateData.data['total_linked_aggregate']} Linked Aggregates")
|
row.label(text="Not a Linked Aggregate")
|
||||||
op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_DATA_POINTCLOUD")
|
else:
|
||||||
op.select_parts = False
|
row.label(text=f"{Number_Linked_Aggregates} Linked Aggregates")
|
||||||
op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_OB_POINTCLOUD")
|
op = row.operator("bim.object_duplicate_move_linked_aggregate_macro", text="", icon="DUPLICATE")
|
||||||
op.select_parts = True
|
if type(Number_Linked_Aggregates) is int:
|
||||||
row.operator("bim.refresh_linked_aggregate", text="", icon="FILE_REFRESH")
|
if Number_Linked_Aggregates > 0:
|
||||||
op = row.operator("bim.break_link_to_other_aggregates", text="", icon="X")
|
op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_DATA_POINTCLOUD")
|
||||||
|
op.select_parts = False
|
||||||
|
op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_OB_POINTCLOUD")
|
||||||
|
op.select_parts = True
|
||||||
|
row.operator("bim.refresh_linked_aggregate", text="", icon="FILE_REFRESH")
|
||||||
|
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"}
|
||||||
|
|||||||
Reference in New Issue
Block a user