@@ -3605,13 +3605,15 @@ def imprint_vector_projection(
36053605 return self ._imprint_projection (assignment , keep_originals , False , vector_points , distance )
36063606
36073607 @pyaedt_function_handler (theList = "assignment" )
3608- def purge_history (self , assignment ):
3608+ def purge_history (self , assignment , non_model = False ):
36093609 """Purge history objects from object names.
36103610
36113611 Parameters
36123612 ----------
36133613 assignment : list
36143614 List of object names to purge.
3615+ non_model : bool, optional
3616+ Convert new parts to non-model objects. The default is ``False``.
36153617
36163618 Returns
36173619 -------
@@ -3621,10 +3623,21 @@ def purge_history(self, assignment):
36213623 References
36223624 ----------
36233625 >>> oEditor.PurgeHistory
3626+
3627+ Examples
3628+ --------
3629+ >>> from ansys.aedt.core import Hfss
3630+ >>> app = Hfss()
3631+ >>> cylinder1 = hfss.modeler.create_cylinder(orientation="X", origin=[5, 0, 0], radius=1, height=20)
3632+ >>> aedtapp.modeler.purge_history(assignment=cylinder1)
36243633 """
36253634 szList = self .convert_to_selections (assignment )
36263635
3627- vArg1 = ["NAME:Selections" , "Selections:=" , szList , "NewPartsModelFlag:=" , "Model" ]
3636+ new_parts = "NonModel"
3637+ if not non_model :
3638+ new_parts = "Model"
3639+
3640+ vArg1 = ["NAME:Selections" , "Selections:=" , szList , "NewPartsModelFlag:=" , new_parts ]
36283641
36293642 self .oeditor .PurgeHistory (vArg1 )
36303643 return True
@@ -4269,13 +4282,15 @@ def create_object_list(self, assignment, name=None):
42694282 return False
42704283
42714284 @pyaedt_function_handler (objectname = "assignment" )
4272- def generate_object_history (self , assignment ):
4285+ def generate_object_history (self , assignment , non_model = False ):
42734286 """Generate history for the object.
42744287
42754288 Parameters
42764289 ----------
42774290 assignment : str
42784291 Name of the history object.
4292+ non_model : bool, optional
4293+ Convert new parts to non-model objects. The default is ``False``.
42794294
42804295 Returns
42814296 -------
@@ -4285,10 +4300,23 @@ def generate_object_history(self, assignment):
42854300 References
42864301 ----------
42874302 >>> oEditor.GenerateHistory
4303+
4304+ Examples
4305+ --------
4306+ >>> from ansys.aedt.core import Hfss
4307+ >>> app = Hfss()
4308+ >>> cylinder1 = hfss.modeler.create_cylinder(orientation="X", origin=[5, 0, 0], radius=1, height=20)
4309+ >>> aedtapp.modeler.purge_history(assignment=cylinder1)
4310+ >>> aedtapp.modeler.generate_object_history(assignment=cylinder1)
42884311 """
42894312 assignment = self .convert_to_selections (assignment )
4313+
4314+ new_parts = "NonModel"
4315+ if not non_model :
4316+ new_parts = "Model"
4317+
42904318 self .oeditor .GenerateHistory (
4291- ["NAME:Selections" , "Selections:=" , assignment , "NewPartsModelFlag:=" , "Model" , "UseCurrentCS:=" , True ]
4319+ ["NAME:Selections" , "Selections:=" , assignment , "NewPartsModelFlag:=" , new_parts , "UseCurrentCS:=" , True ]
42924320 )
42934321 self .cleanup_objects ()
42944322 return True
0 commit comments