From 45de750790665b4341b31372bbfe2b0149b30fa1 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Fri, 19 Dec 2025 12:44:23 -0600 Subject: [PATCH] Fixes #7507: Fix: Prevent spatial element placement corruption during drawing activation sync_references was syncing spatial element placements FROM Blender TO IFC, corrupting their correct positions. Spatial elements (storeys, spaces, buildings) often have Blender objects at Z=0 for modeling convenience, but their IFC placements store absolute positions. Solution: Skip syncing placements for IfcSpatialElement and IfcGrid types, as their IFC placement is the source of truth. Fixes storey elevation corruption during SECTION_LEVEL annotation generation. --- src/bonsai/bonsai/core/drawing.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/bonsai/bonsai/core/drawing.py b/src/bonsai/bonsai/core/drawing.py index f30c49974d..118fc3b69c 100644 --- a/src/bonsai/bonsai/core/drawing.py +++ b/src/bonsai/bonsai/core/drawing.py @@ -487,12 +487,29 @@ def sync_references( potential_reference_elements = drawing_tool.get_potential_reference_elements(drawing) for element in potential_reference_elements: + # Skip spatial elements - their IFC placement is the source of truth + if element.is_a("IfcSpatialElement"): + continue + + # Skip grids - their IFC placement is the source of truth + if element.is_a("IfcGrid") or element.is_a("IfcGridAxis"): + continue + if (obj := ifc.get_object(element)) and ifc.is_moved(obj): drawing_tool.sync_object_placement(obj) for element in drawing_tool.get_group_elements(group): if not drawing_tool.is_auto_annotation(element): continue + + # Skip spatial elements - should never sync their placement + if element.is_a("IfcSpatialElement"): + continue + + # Skip grids + if element.is_a("IfcGrid") or element.is_a("IfcGridAxis"): + continue + if (obj := ifc.get_object(element)) and ifc.is_moved(obj): drawing_tool.sync_object_placement(obj) if not (reference_element := drawing_tool.get_assigned_product(element)):