Model.hm_entitiesassociatedbygroupsmark#

Model.hm_entitiesassociatedbygroupsmark(input_collection, output_collectionset, group_collection=Collection(), level=0)#

Selects entities associated to each other through groups.

Parameters:
  • input_collection (Collection) – The collection containing the input entities. Valid entities are nodes, elements and components (only elements in components are considered).

  • output_collectionset (CollectionSet) – The set of collections containing the isolated output entities which contains possibly multiple type of entities (nodes, elements and components).

  • group_collection (Collection) – The collection containing the group entities to consider for association.

  • level (int) –

    0 - No level down

    Comps

    Elems

    Nodes

    1 - One level done

    Comps -> Elems

    Elems -> Nodes

    Nodes

    2 - Two levels down

    Comps -> Elems -> Nodes

    Elems -> Nodes

    Nodes

    The reverse is performed on the output.

Returns:

Example#

Finding nodes, elems and comps associated to comps 1-5 by all groups#
import hm
import hm.entities as ent

model = hm.Model()

model.hm_entitiesassociatedbygroupsmark(
    input_collection=hm.Collection(model, ent.Component, list(range(1,6))),
    output_collectionset=hm.CollectionSet(model),
    level=2)