Model.addfacestocontactsurfusingfacenumber#

Model.addfacestocontactsurfusingfacenumber(name, collection, face_number, reverse_normals, element_id, use_element_id)#

Adds elements using the face number to a contact surface.

Parameters:
  • name (hwString) – The name of the contact surface to update. User can directly supply a Python string.

  • collection (Collection) – The collection containing the element entities to add.

  • face_number (int) – The face number of the element (starting from 0).

  • reverse_normals (int) –

    Valid values are:

    0 - Create contact surface along element normal.

    1 - Create contact surface opposite element normal.

  • element_id (int) – The single element ID to use.

  • use_element_id (int) –

    Valid values are:

    0 - Use collection.

    1 - Use element_id.

Example#

Add elements with IDs 1 - 100 use face number 2 to contactsurf “ test “#
import hm
import hm.entities as ent

model = hm.Model()

# One-line version of collection using FilterByEnumeration
elem_col = hm.Collection(model, ent.Element, list(range(1, 101)))  # ID 1-100

model.addfacestocontactsurfusingfacenumber(
    name="test",
    collection=elem_col,
    face_number=2,
    reverse_normals=0,
    element_id=0,
    use_element_id=0,
)