Model.contactsurfcreatewithfacesusingfacenumber#

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

Creates a contact surface using 2D element edges or 2D/3D element faces.

Parameters:
  • name (hwString) – The name of the contact surface to create.

  • color (int) – The color of the contact surface. Valid values are 1 through 64.

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

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

  • reverse_normals (int) –

    0 - Create contact surface along element normal.

    1 - Create contact surface opposite element normal.

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

  • use_element_id (int) –

    0 - Use collection (default).

    1 - Use element_id.

Example#

Create a contact surface named “test” with elements with IDs 1-100 using face number 3#
import hm
import hm.entities as ent

model = hm.Model()

model.contactsurfcreatewithfacesusingfacenumber(
    name="test",
    color=5,
    collection=hm.Collection(model, ent.Element, list(range(1, 101))),
    face_number=3,
    reverse_normals=0,
    element_id=0,
    use_element_id=0,
)