diff --git a/src/ansys/aedt/core/modeler/modeler_pcb.py b/src/ansys/aedt/core/modeler/modeler_pcb.py index 6a96d2d64dc..1eb485a22b9 100644 --- a/src/ansys/aedt/core/modeler/modeler_pcb.py +++ b/src/ansys/aedt/core/modeler/modeler_pcb.py @@ -739,14 +739,14 @@ def duplicate(self, assignment, count, vector): assignment : list List of elements to duplicate. count : int - + Number of clones. vector : list List of ``[x,y]`` coordinates for the direction vector. Returns ------- - bool - ``True`` when successful, ``False`` when failed. + tuple + List of added objects, List of removed names. References ---------- @@ -756,9 +756,7 @@ def duplicate(self, assignment, count, vector): assignment = self.convert_to_selections(assignment, True) self.cleanup_objects() - if isinstance(assignment, str): - assignment = [assignment] - self.oeditor.Duplicate(["NAME:options", "count:=", count], ["NAME:elements", ",".join(assignment)], vector) + self.oeditor.Duplicate(["NAME:options", "count:=", count], ["NAME:elements"] + assignment, vector) return self.cleanup_objects() @pyaedt_function_handler(objects="assignment") diff --git a/tests/system/general/test_41_3dlayout_modeler.py b/tests/system/general/test_41_3dlayout_modeler.py index cc4260d976b..8dbf26bd4c6 100644 --- a/tests/system/general/test_41_3dlayout_modeler.py +++ b/tests/system/general/test_41_3dlayout_modeler.py @@ -597,7 +597,9 @@ def test_21_variables(self): def test_26_duplicate(self): n2 = self.aedtapp.modeler.create_rectangle("Top", [0, 0], [6, 8], 3, 2, "myrectangle_d") - assert self.aedtapp.modeler.duplicate("myrectangle_d", 2, [1, 1]) + n3 = self.aedtapp.modeler.create_rectangle("Top", [0, 0], [6, 8], 3, 2, "myrectangle_d2") + new_objects = self.aedtapp.modeler.duplicate([n2.name, n3.name], 2, [1, 1]) + assert len(new_objects[0]) == 4 assert self.aedtapp.modeler.duplicate_across_layers("myrectangle_d", "Bottom") def test_27_create_pin_port(self):