Model.segmentsetcreateusingfacenumber#

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

Creates a segment set using 2D element edges or 2D/3D element faces.

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

  • color (int) – The color of the segment set. Valid values are 1-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) –

    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 (int) – If non-zero, specifies to use element_id instead of collection.

Example#

Create a segment set named “ test “ with elements with IDs 1 - 100 use face_number=3 :#
import hm
import hm.entities as ent

model = hm.Model()

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

model.segmentsetaddfacesusingfacenumber(
    name="test",
    color=5,
    collection=elements_collection,
    face_number=3,
    reverse_normals=0,
    element_id=1,
    option=0,
)