Model.segmentsetcreatewithshells#

Model.segmentsetcreatewithshells(name, color, collection, reverse_normals)#

Creates a segment set using 1D or 2D elements.

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

  • color (int) – The color of the segment set. Valid values are 1-64.

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

  • reverse_normals (int) –

    Create segment set:

    0 - Along element normal

    1 - Opposite element normal

Example#

Create a segment set named “ test “ with the elements with IDs 1 - 100#
import hm
import hm.entities as ent

model = hm.Model()

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

model.segmentsetcreatewithshells(
    name="test", color=5, collection=elements_collection, reverse_normals=0
)