Model.morphorganizedomain#

Model.morphorganizedomain(elemcollection, domain, type, rethand)#

Organizes elements in a collection into specified domain.

Parameters:
  • elemcollection (Collection) – The collection containing the entities. Valid entities are nodes (for global domains) and elements (for non-global domains).

  • domain (Entity) – The domain entity

  • type (int) –

    0 - Global domain

    1 - 1D domain

    2 - 2D domain

    3 - 3D domain

    7- General domain

  • rethand (int) –

    0 - Do not retain handles

    1 - Retain handles

Example#

The elements selected interactively are removed from the domains that they are in and placed into the domain with ID 2. Elements not in the selection are removed from the specified domain. Thus the specified domain will retain only the selected elements.#
import hm
import hm.entities as ent

model = hm.Model()

model.morphorganizedomain(
    elemcollection=hm.CollectionByInteractiveSelection(model, ent.Element),
    domain=ent.Domain(model, 2),
    type=2,
    rethand=0,
)

Note

The type specified notes which nodes or elements in the collection will be retained. If no elements of the correct type are on the collection for non-global domains the function will exit.