From 6ba5f5af3dd114d42035f74f8f7e07ca0f53275b Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Thu, 28 May 2026 21:21:16 -0500 Subject: [PATCH] Fix CardinalPoint not applied to all selected objects EditAssignedMaterial propagated layer set usage attributes to all selected objects but skipped this loop for profile set usage. Add the same loop so CardinalPoint and ReferenceExtent are copied to each selected object's IfcMaterialProfileSetUsage on save. Generated with the assistance of an AI coding tool. --- src/bonsai/bonsai/bim/module/material/operator.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/material/operator.py b/src/bonsai/bonsai/bim/module/material/operator.py index 8a54478179..6ec1ccf188 100644 --- a/src/bonsai/bonsai/bim/module/material/operator.py +++ b/src/bonsai/bonsai/bim/module/material/operator.py @@ -637,6 +637,16 @@ class EditAssignedMaterial(bpy.types.Operator, tool.Ifc.Operator): usage=material_set_usage, attributes=attributes, ) + + for obj in objects: + obj_element = tool.Ifc.get_entity(obj) + if not obj_element: + continue + obj_material_usage = ifcopenshell.util.element.get_material(obj_element) + if obj_material_usage and obj_material_usage.is_a("IfcMaterialProfileSetUsage"): + obj_material_usage.CardinalPoint = material_set_usage.CardinalPoint + obj_material_usage.ReferenceExtent = material_set_usage.ReferenceExtent + model_profile.DumbProfileRecalculator().recalculate(objects) bpy.ops.bim.disable_editing_assigned_material(obj=active_obj.name)