@@ -2361,7 +2361,14 @@ def split(self, objects, plane, sides="Both"):
2361
2361
return True
2362
2362
2363
2363
@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
+ ):
2365
2372
"""Duplicate and mirror a selection.
2366
2373
2367
2374
Parameters
@@ -2376,6 +2383,8 @@ def duplicate_and_mirror(self, objid, position, vector, is_3d_comp=False):
2376
2383
Application.Position object for the vector.
2377
2384
is_3d_comp : bool, optional
2378
2385
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``.
2379
2388
2380
2389
Returns
2381
2390
-------
@@ -2399,7 +2408,7 @@ def duplicate_and_mirror(self, objid, position, vector, is_3d_comp=False):
2399
2408
vArg2 .append ("DuplicateMirrorNormalX:=" ), vArg2 .append (Xnorm )
2400
2409
vArg2 .append ("DuplicateMirrorNormalY:=" ), vArg2 .append (Ynorm )
2401
2410
vArg2 .append ("DuplicateMirrorNormalZ:=" ), vArg2 .append (Znorm )
2402
- vArg3 = ["NAME:Options" , "DuplicateAssignments:=" , False ]
2411
+ vArg3 = ["NAME:Options" , "DuplicateAssignments:=" , duplicate_assignment ]
2403
2412
if is_3d_comp :
2404
2413
orig_3d = [i for i in self .components_3d_names ]
2405
2414
added_objs = self .oeditor .DuplicateMirror (vArg1 , vArg2 , vArg3 )
@@ -2489,7 +2498,16 @@ def move(self, objid, vector):
2489
2498
return True
2490
2499
2491
2500
@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
+ ):
2493
2511
"""Duplicate a selection around an axis.
2494
2512
2495
2513
Parameters
@@ -2507,6 +2525,8 @@ def duplicate_around_axis(self, objid, cs_axis, angle=90, nclones=2, create_new_
2507
2525
default is ``True``.
2508
2526
is_3d_comp : bool, optional
2509
2527
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``.
2510
2530
2511
2531
Returns
2512
2532
-------
@@ -2531,7 +2551,7 @@ def duplicate_around_axis(self, objid, cs_axis, angle=90, nclones=2, create_new_
2531
2551
"Numclones:=" ,
2532
2552
str (nclones ),
2533
2553
]
2534
- vArg3 = ["NAME:Options" , "DuplicateBoundaries :=" , "true" ]
2554
+ vArg3 = ["NAME:Options" , "DuplicateAssignments :=" , duplicate_assignment ]
2535
2555
if is_3d_comp :
2536
2556
orig_3d = [i for i in self .components_3d_names ]
2537
2557
added_objs = self .oeditor .DuplicateAroundAxis (vArg1 , vArg2 , vArg3 )
@@ -2552,7 +2572,15 @@ def _duplicate_added_objects_tuple(self):
2552
2572
return False , []
2553
2573
2554
2574
@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
+ ):
2556
2584
"""Duplicate a selection along a line.
2557
2585
2558
2586
Parameters
@@ -2568,6 +2596,9 @@ def duplicate_along_line(self, objid, vector, nclones=2, attachObject=False, is_
2568
2596
Number of clones. The default is ``2``.
2569
2597
is_3d_comp : bool, optional
2570
2598
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
+
2571
2602
Returns
2572
2603
-------
2573
2604
tuple
@@ -2587,7 +2618,7 @@ def duplicate_along_line(self, objid, vector, nclones=2, attachObject=False, is_
2587
2618
vArg2 .append ("YComponent:=" ), vArg2 .append (Ypos )
2588
2619
vArg2 .append ("ZComponent:=" ), vArg2 .append (Zpos )
2589
2620
vArg2 .append ("Numclones:=" ), vArg2 .append (str (nclones ))
2590
- vArg3 = ["NAME:Options" , "DuplicateBoundaries :=" , "true" ]
2621
+ vArg3 = ["NAME:Options" , "DuplicateAssignments :=" , duplicate_assignment ]
2591
2622
if is_3d_comp :
2592
2623
orig_3d = [i for i in self .components_3d_names ]
2593
2624
added_objs = self .oeditor .DuplicateAlongLine (vArg1 , vArg2 , vArg3 )
@@ -2598,7 +2629,6 @@ def duplicate_along_line(self, objid, vector, nclones=2, attachObject=False, is_
2598
2629
self .logger .info ("Found 3D Components Duplication" )
2599
2630
return True , added_3d_comps
2600
2631
return True , list (added_objs )
2601
- # return self._duplicate_added_objects_tuple()
2602
2632
2603
2633
@pyaedt_function_handler ()
2604
2634
def thicken_sheet (self , objid , thickness , bBothSides = False ):
0 commit comments