Skip to content

Commit

Permalink
FIX: Duplicate modeler PCB (#5491)
Browse files Browse the repository at this point in the history
Co-authored-by: abhandare21 <nbahx35@gmail.com>
  • Loading branch information
Samuelopez-ansys and abhandare21 authored Nov 28, 2024
1 parent 076463a commit cbe9860
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/ansys/aedt/core/modeler/modeler_pcb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tests/system/general/test_41_3dlayout_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit cbe9860

Please sign in to comment.