Model.hm_getwhollycontainedcollectormark#

Model.hm_getwhollycontainedcollectormark(collection, collector_collectionset, reverse)#

Returns the collectors that fully contain the input entities.

Parameters:
  • collection (Collection) – The collection containing the input entities to query. Valid entities are elements, loads, curves, systems, vectors.

  • collector_collectionset (CollectionSet) –

    The set of collections containing the collectors that fully contain the input entities. Respectively to the enitity type of collection the entity types can be:

    • For elements in collection \(\rightarrow\) the entity type is component.

    • For loads in collection \(\rightarrow\) the entity type is load collector.

    • For curves in collection \(\rightarrow\) the entity type is plot.

    • For systems in collection \(\rightarrow\) the entity type is system collector.

    • For vector in collection \(\rightarrow\) the entity type is vector collector.

  • reverse (bool) –

    0 - Find only fully contained collectors.

    1 - Find not-fully contained collectors.

Returns:

Examples#

Find the components that fully contain elements with IDs 1 - 100#
import hm
import hm.entities as ent

model = hm.Model()

elem_collection = hm.Collection(model,ent.Element,list(range(1,101)))
out_colSet = hm.CollectionSet(model)
model.hm_getwhollycontainedcollectormark(collection=elem_collection,collector_collectionset=out_colSet,reverse=0)

for col in out_colSet:
    print("Collector type:", col.eclass.__name__)
    print("Collectors:", [c.id for c in col])
Find the components that simply contain elements with IDs 1 - 100#
import hm
import hm.entities as ent

model = hm.Model()

elem_collection = hm.Collection(model,ent.Element,list(range(1,101)))
out_colSet = hm.CollectionSet(model)
model.hm_getwhollycontainedcollectormark(collection=elem_collection,collector_collectionset=out_colSet,reverse=1)

for col in out_colSet:
    print("Collector type:", col.eclass.__name__)
    print("Collectors:", [c.id for c in col])