Model.deletesolidswithelems#

Model.deletesolidswithelems(collection, keep_shell, keep_elems)#

Deletes solids. Includes the option to keep boundary surfaces, and an option to keep attached elements.

Parameters:
  • collection (Collection) – The collection containing the solid entities to be deleted.

  • keep_shell (int) –

    0 - Solids are deleted along with their connected boundary surfaces (except any surfaces connected to other solids that are not being deleted).

    If set to any nonzero value, the surfaces that make the boundary of each solid are not deleted.

  • keep_elems (int) –

    Overrides the auto delete elements setting in the options panel.

    0 - Elements associated with solids will be deleted along with the solids.

    If set to any nonzero value, such elements will not be deleted.

Example#

Delete solid with ID 5 and keep its boundary surfaces , but delete elements#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the solids to be deleted
solid_collection = hm.Collection(model, ent.Solid, [5])

model.deletesolidswithelems(collection=solid_collection, keep_shell=1, keep_elems=0)