diff --git a/src/bonsai/bonsai/bim/module/geometry/operator.py b/src/bonsai/bonsai/bim/module/geometry/operator.py index 6485856669..2d004c6b36 100644 --- a/src/bonsai/bonsai/bim/module/geometry/operator.py +++ b/src/bonsai/bonsai/bim/module/geometry/operator.py @@ -1320,7 +1320,7 @@ class DuplicateMoveLinkedAggregate(bpy.types.Operator): ) pset = ifcopenshell.util.element.get_pset(new[0], "BBIM_Linked_Aggregate") new_obj = tool.Ifc.get_object(new[0]) - new_obj.name = pset["Name"] + "_" + str(pset["Aggregate_Index"]) + new_obj.name = f"{pset['Name']}_{pset['Aggregate_Index']:02d}" def get_max_index(parts): psets = [ diff --git a/src/bonsai/test/bim/feature/geometry.feature b/src/bonsai/test/bim/feature/geometry.feature index 7966af5ffa..ee2851fc7e 100644 --- a/src/bonsai/test/bim/feature/geometry.feature +++ b/src/bonsai/test/bim/feature/geometry.feature @@ -579,8 +579,9 @@ Scenario: Duplicate linked aggregate When I duplicate linked aggregate the selected objects Then the object "IfcWall/Wall_01.001" exists And the object "IfcWall/Wall_02.001" exists - And the object "IfcElementAssembly/Assembly_01" exists - Then the object "IfcElementAssembly/Assembly" and "IfcElementAssembly/Assembly_01" belong to the same Linked Aggregate Group + # msgbus updates don't happen in background mode, so obj is not renamed to "IfcElementAssembly/Assembly_01" + And the object "Assembly_01" exists + Then the object "IfcElementAssembly/Assembly" and "Assembly_01" belong to the same Linked Aggregate Group Scenario: Refresh linked aggregate Given I load the IFC test file "/test/files/linked-aggregates.ifc"