diff --git a/src/bonsai/bonsai/bim/export_ifc.py b/src/bonsai/bonsai/bim/export_ifc.py index 993622ff1c..715f092ac4 100644 --- a/src/bonsai/bonsai/bim/export_ifc.py +++ b/src/bonsai/bonsai/bim/export_ifc.py @@ -120,10 +120,10 @@ class IfcExporter: # updata_representation will run edit_object_placement if object is scaled # and had no openings. return element - if not tool.Ifc.is_moved(obj): - return if element.is_a("IfcGridAxis"): return self.sync_grid_axis_object_placement(obj, element) + if not tool.Ifc.is_moved(obj): + return if not hasattr(element, "ObjectPlacement"): return bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj) diff --git a/src/bonsai/bonsai/tool/geometry.py b/src/bonsai/bonsai/tool/geometry.py index c4b7cd0ef6..4ba6a8b6b9 100644 --- a/src/bonsai/bonsai/tool/geometry.py +++ b/src/bonsai/bonsai/tool/geometry.py @@ -2670,6 +2670,11 @@ class Geometry(bonsai.core.tool.Geometry): # copy the actual class new = bonsai.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj) + # Give each duplicated IfcGridAxis its own AxisCurve so it doesn't + # share geometry with the source axis. + if new and new.is_a("IfcGridAxis"): + tool.Model.create_axis_curve(new_obj, new) + # clean up the orphaned mesh with ifc id of the original object to avoid confusion # IfcGridAxis keeps the same mesh data (it's pointing to ifc id 0, so it's not a problem) if new and temp_data and not new.is_a("IfcGridAxis"): diff --git a/src/ifcopenshell-python/ifcopenshell/api/grid/create_axis_curve.py b/src/ifcopenshell-python/ifcopenshell/api/grid/create_axis_curve.py index 9c4a9aa1c8..e6c1362d76 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/grid/create_axis_curve.py +++ b/src/ifcopenshell-python/ifcopenshell/api/grid/create_axis_curve.py @@ -89,5 +89,5 @@ def create_axis_curve( ), ) - if existing_curve: + if existing_curve and file.get_total_inverses(existing_curve) == 0: ifcopenshell.util.element.remove_deep2(file, existing_curve)