@@ -1481,6 +1481,66 @@ def cover_faces(self, assignment):
1481
1481
self .oeditor .CoverSurfaces (["NAME:Selections" , "Selections:=" , obj_to_cover , "NewPartsModelFlag:=" , "Model" ])
1482
1482
return True
1483
1483
1484
+ @pyaedt_function_handler ()
1485
+ def uncover_faces (self , assignment ):
1486
+ """Uncover faces.
1487
+
1488
+ Parameters
1489
+ ----------
1490
+ assignment : list
1491
+ Sheet objects to uncover.
1492
+
1493
+ Returns
1494
+ -------
1495
+ bool
1496
+ ``True`` when successful, ``False`` when failed.
1497
+
1498
+ References
1499
+ ----------
1500
+ >>> oEditor.UncoverFaces
1501
+
1502
+ Examples
1503
+ --------
1504
+ >>> from ansys.aedt.core import Maxwell3D
1505
+ >>> app = Maxwell3D()
1506
+ >>> circle_1 = app.modeler.create_circle(cs_plane=0, position=[0, 0, 0], radius=3, name="Circle1")
1507
+ >>> box_1 = app.modeler.create_box(origin=[-13.9 ,0 ,0],sizes=[27.8,-40,25.4], name="Box1")
1508
+ >>> app.modeler.uncover_faces([circle_1.faces[0], [box_1.faces[0], box_1.faces[2]]])
1509
+ """
1510
+
1511
+ faces = {}
1512
+ flat_assignment = []
1513
+
1514
+ # create a flat list from assignment
1515
+ for item in assignment :
1516
+ if isinstance (item , list ):
1517
+ flat_assignment .extend (item )
1518
+ else :
1519
+ flat_assignment .append (item )
1520
+
1521
+ # loop through each item in the flattened list and create a dictionary
1522
+ # associating object names to the face ids of faces to be uncovered
1523
+ for fid in flat_assignment :
1524
+ face_id = int (self .convert_to_selections (fid , False ))
1525
+ if fid .name not in faces .keys ():
1526
+ faces [fid .name ] = [face_id ]
1527
+ elif fid .name in faces .keys ():
1528
+ faces [fid .name ].append (face_id )
1529
+
1530
+ # create variables used in the native api in the right format
1531
+ # for selections a concatenated string and for faces_to_uncover a list of int
1532
+ selections = ", " .join (str (x ) for x in faces .keys ())
1533
+ faces_to_uncover = []
1534
+ for key in faces .keys ():
1535
+ faces_to_uncover .append (["NAME:UncoverFacesParameters" , "FacesToUncover:=" , faces [key ]])
1536
+ # call native api to uncover assigned faces
1537
+ self .oeditor .UncoverFaces (
1538
+ ["NAME:Selections" , "Selections:=" , selections , "NewPartsModelFlag:=" , "Model" ],
1539
+ ["NAME:Parameters" , * faces_to_uncover ],
1540
+ )
1541
+
1542
+ return True
1543
+
1484
1544
@pyaedt_function_handler ()
1485
1545
def create_coordinate_system (
1486
1546
self ,
0 commit comments