From f4ecbf00554994fef46807dfe469e5918fcc437c Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sun, 16 Nov 2025 14:01:57 -0600 Subject: [PATCH] don't allow editing LAYER2 objects. --- src/bonsai/bonsai/bim/module/geometry/operator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/geometry/operator.py b/src/bonsai/bonsai/bim/module/geometry/operator.py index 027ee3a3c4..b40a400ae9 100644 --- a/src/bonsai/bonsai/bim/module/geometry/operator.py +++ b/src/bonsai/bonsai/bim/module/geometry/operator.py @@ -2544,7 +2544,6 @@ class OverrideModeSetObject(bpy.types.Operator, tool.Ifc.Operator): props.is_changing_mode = False - class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.direct_profile_edit" bl_label = "IFC Direct Profile Edit" @@ -2615,6 +2614,12 @@ class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator): self.report({"ERROR"}, "Active object is not an IFC element") return {"CANCELLED"} + # Check if this is a LAYER2 element (wall, railing, etc.) + material_usage = tool.Model.get_usage_type(element) + if material_usage == "LAYER2": + self.report({"ERROR"}, "LAYER2 elements (walls, railings, etc.) cannot use profile editing.") + return {"CANCELLED"} + representation = tool.Geometry.get_active_representation(obj) if not representation: self.report({"ERROR"}, "Object has no active representation") @@ -2678,7 +2683,6 @@ class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator): return {"FINISHED"} - class FlipObject(bpy.types.Operator): bl_idname = "bim.flip_object" bl_label = "Flip Object"