Model.ME_ModuleOccurrencesPurge#
- Model.ME_ModuleOccurrencesPurge(occurences, excluded_entity_types=std::vector< EntityFullType >(), reset_representation=0, recursive=1)#
Empties the contents of multiple module parts.
- Parameters:
occurences (EntityList) – A list containing the part entities to purge.
excluded_entity_types (_EntityFullTypeList_vector) – The list of entity classes to not remove.
reset_representation (int) –
0 - Keep representation reference information.
1 - Remove representation reference information.
recursive (int) –
0 - Purge only the local module’s contents. Do not touch the child module’s contents (in the case of a part assembly).
1 - Recursively purge the module, as well as any child modules.
Example#
Purge part with IDs 168, 169, 170 and any of their child parts, remove all of their contents except for property and material entities. Remove representation reference information#import hm import hm.entities as ent model = hm.Model() model.ME_ModuleOccurrencesPurge( occurences=[ent.Part(model, 168), ent.Part(model, 169), ent.Part(model, 170)], excluded_entity_types=[ent.Property, ent.Material], reset_representation=1, )