Model.segmentsetaddfacesusingfacenumber#

Model.segmentsetaddfacesusingfacenumber(name, collection, face_number, reverse_normals, element_id, option)#

Adds faces of elements using a specific face number to a segment set.

Parameters:
  • name (hwString) – The name of the segment set to update.

  • 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) –

    Create segment set:

    0 - Along element normal

    1 - Opposite element normal

  • element_id (int) – If non-zero, specifies the single element to use instead of collection. Option must be set non-zero.

  • option (int) – If non-zero, specifies to use element_id instead of collection.

Example#

Add elements with IDs 1 - 100 use face_number=2 to segment set “ test “#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the elements to add
filter_add_elements = hm.FilterByEnumeration(ent.Element, list(range(1, 101)))
add_elements_collection = hm.Collection(model, filter_add_elements)

model.segmentsetaddfacesusingfacenumber(
    name="test",
    collection=add_elements_collection,
    face_number=2,
    reverse_normals=0,
    element_id=1,
    option=0,
)