Skip to content

Commit 38b6cdf

Browse files
Fix duplicate along line typo (#1316)
* - Typo in method * - DuplicateBoundaries replaced to DuplicateAssignments
1 parent 3f02089 commit 38b6cdf

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

pyaedt/modeler/Modeler.py

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,14 @@ def split(self, objects, plane, sides="Both"):
23612361
return True
23622362

23632363
@pyaedt_function_handler()
2364-
def duplicate_and_mirror(self, objid, position, vector, is_3d_comp=False):
2364+
def duplicate_and_mirror(
2365+
self,
2366+
objid,
2367+
position,
2368+
vector,
2369+
is_3d_comp=False,
2370+
duplicate_assignment=True,
2371+
):
23652372
"""Duplicate and mirror a selection.
23662373
23672374
Parameters
@@ -2376,6 +2383,8 @@ def duplicate_and_mirror(self, objid, position, vector, is_3d_comp=False):
23762383
Application.Position object for the vector.
23772384
is_3d_comp : bool, optional
23782385
If ``True``, the method will try to return the duplicated list of 3dcomponents. The default is ``False``.
2386+
duplicate_assignment : bool, optional
2387+
If True, the method duplicates selection assignments. The default value is ``True``.
23792388
23802389
Returns
23812390
-------
@@ -2399,7 +2408,7 @@ def duplicate_and_mirror(self, objid, position, vector, is_3d_comp=False):
23992408
vArg2.append("DuplicateMirrorNormalX:="), vArg2.append(Xnorm)
24002409
vArg2.append("DuplicateMirrorNormalY:="), vArg2.append(Ynorm)
24012410
vArg2.append("DuplicateMirrorNormalZ:="), vArg2.append(Znorm)
2402-
vArg3 = ["NAME:Options", "DuplicateAssignments:=", False]
2411+
vArg3 = ["NAME:Options", "DuplicateAssignments:=", duplicate_assignment]
24032412
if is_3d_comp:
24042413
orig_3d = [i for i in self.components_3d_names]
24052414
added_objs = self.oeditor.DuplicateMirror(vArg1, vArg2, vArg3)
@@ -2489,7 +2498,16 @@ def move(self, objid, vector):
24892498
return True
24902499

24912500
@pyaedt_function_handler()
2492-
def duplicate_around_axis(self, objid, cs_axis, angle=90, nclones=2, create_new_objects=True, is_3d_comp=False):
2501+
def duplicate_around_axis(
2502+
self,
2503+
objid,
2504+
cs_axis,
2505+
angle=90,
2506+
nclones=2,
2507+
create_new_objects=True,
2508+
is_3d_comp=False,
2509+
duplicate_assignment=True,
2510+
):
24932511
"""Duplicate a selection around an axis.
24942512
24952513
Parameters
@@ -2507,6 +2525,8 @@ def duplicate_around_axis(self, objid, cs_axis, angle=90, nclones=2, create_new_
25072525
default is ``True``.
25082526
is_3d_comp : bool, optional
25092527
If ``True``, the method will try to return the duplicated list of 3dcomponents. The default is ``False``.
2528+
duplicate_assignment : bool, optional
2529+
If True, the method duplicates selection assignments. The default value is ``True``.
25102530
25112531
Returns
25122532
-------
@@ -2531,7 +2551,7 @@ def duplicate_around_axis(self, objid, cs_axis, angle=90, nclones=2, create_new_
25312551
"Numclones:=",
25322552
str(nclones),
25332553
]
2534-
vArg3 = ["NAME:Options", "DuplicateBoundaries:=", "true"]
2554+
vArg3 = ["NAME:Options", "DuplicateAssignments:=", duplicate_assignment]
25352555
if is_3d_comp:
25362556
orig_3d = [i for i in self.components_3d_names]
25372557
added_objs = self.oeditor.DuplicateAroundAxis(vArg1, vArg2, vArg3)
@@ -2552,7 +2572,15 @@ def _duplicate_added_objects_tuple(self):
25522572
return False, []
25532573

25542574
@pyaedt_function_handler()
2555-
def duplicate_along_line(self, objid, vector, nclones=2, attachObject=False, is_3d_comp=False):
2575+
def duplicate_along_line(
2576+
self,
2577+
objid,
2578+
vector,
2579+
nclones=2,
2580+
attachObject=False,
2581+
is_3d_comp=False,
2582+
duplicate_assignment=True,
2583+
):
25562584
"""Duplicate a selection along a line.
25572585
25582586
Parameters
@@ -2568,6 +2596,9 @@ def duplicate_along_line(self, objid, vector, nclones=2, attachObject=False, is_
25682596
Number of clones. The default is ``2``.
25692597
is_3d_comp : bool, optional
25702598
If True, the method will try to return the duplicated list of 3dcomponents. The default is ``False``.
2599+
duplicate_assignment : bool, optional
2600+
If True, the method duplicates selection assignments. The default value is ``True``.
2601+
25712602
Returns
25722603
-------
25732604
tuple
@@ -2587,7 +2618,7 @@ def duplicate_along_line(self, objid, vector, nclones=2, attachObject=False, is_
25872618
vArg2.append("YComponent:="), vArg2.append(Ypos)
25882619
vArg2.append("ZComponent:="), vArg2.append(Zpos)
25892620
vArg2.append("Numclones:="), vArg2.append(str(nclones))
2590-
vArg3 = ["NAME:Options", "DuplicateBoundaries:=", "true"]
2621+
vArg3 = ["NAME:Options", "DuplicateAssignments:=", duplicate_assignment]
25912622
if is_3d_comp:
25922623
orig_3d = [i for i in self.components_3d_names]
25932624
added_objs = self.oeditor.DuplicateAlongLine(vArg1, vArg2, vArg3)
@@ -2598,7 +2629,6 @@ def duplicate_along_line(self, objid, vector, nclones=2, attachObject=False, is_
25982629
self.logger.info("Found 3D Components Duplication")
25992630
return True, added_3d_comps
26002631
return True, list(added_objs)
2601-
# return self._duplicate_added_objects_tuple()
26022632

26032633
@pyaedt_function_handler()
26042634
def thicken_sheet(self, objid, thickness, bBothSides=False):

0 commit comments

Comments
 (0)