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.
This commit is contained in:
Ryan Schultz
2025-12-19 12:44:23 -06:00
parent b1b67de420
commit 45de750790
+17
View File
@@ -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)):