From cbd78506cea6d79b2f81c456e8165273c3853784 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 18 Jun 2025 19:08:37 +0500 Subject: [PATCH] Fix mistake in 96bdda305 - expose IfcApplication purge to UI Noticed a mistake when merge was included twice for applications, instead of including purge+merge. --- src/bonsai/bonsai/bim/module/project/ui.py | 25 ++++++---------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/project/ui.py b/src/bonsai/bonsai/bim/module/project/ui.py index df40dde4af..8d74a36514 100644 --- a/src/bonsai/bonsai/bim/module/project/ui.py +++ b/src/bonsai/bonsai/bim/module/project/ui.py @@ -635,23 +635,10 @@ class BIM_PT_purge(Panel): layout.operator("bim.purge_unused_objects", text="Purge Unused Types").object_type = "TYPE" layout.operator("bim.purge_unused_openings", text="Purge Unused Openings in Selected Objects") - row = layout.row(align=True) - row.label(text="Materials: ") - row.operator("bim.purge_unused_objects", text="Purge Unused").object_type = "MATERIAL" - row.operator("bim.merge_identical_objects", text="Merge Identical").object_type = "MATERIAL" + MERGEABLE_OBJECT_TYPES = ("MATERIAL", "STYLE", "ORGANIZATION", "APPLICATION") - row = layout.row(align=True) - - row.label(text="Styles: ") - row.operator("bim.purge_unused_objects", text="Purge Unused").object_type = "STYLE" - row.operator("bim.merge_identical_objects", text="Merge Identical").object_type = "STYLE" - - row = layout.row(align=True) - row.label(text="Organizations: ") - row.operator("bim.purge_unused_objects", text="Purge Unused").object_type = "ORGANIZATION" - row.operator("bim.merge_identical_objects", text="Merge Identical").object_type = "ORGANIZATION" - - row = layout.row(align=True) - row.label(text="Applications: ") - row.operator("bim.merge_identical_objects", text="Merge Identical").object_type = "APPLICATION" - row.operator("bim.merge_identical_objects", text="Merge Identical").object_type = "APPLICATION" + for object_type in MERGEABLE_OBJECT_TYPES: + row = layout.row(align=True) + row.label(text=f"{object_type.capitalize()}:") + row.operator("bim.purge_unused_objects", text="Purge Unused").object_type = object_type + row.operator("bim.merge_identical_objects", text="Merge Identical").object_type = object_type