Model.hm_getmultilevelreferenceentities#

Model.hm_getmultilevelreferenceentities(input_entities, output_entities)#

Finds all the multi-level reference entities for the entities specified on the input collection.

Each type of entity that is referenced by the specified input entities is returned in a list, and the found entities are placed on the corresponding collection with the specified output collection.

Parameters:
  • input_entities (Collection) – The collection containing the input entities.

  • output_entities (Collection) – The collection containing the found referenced entities.

Returns:

Examples#

Obtain all the entities related to components with IDs 1 and 2#
import hm
import hm.entities as ent

model = hm.Model()

comps = hm.Collection(model, ent.Component, [1, 2])

_, result = model.hm_getmultilevelreferenceentities(
    input_entities=comps,
    output_entities=hm.Collection(model, ent.Component, populate=False)
)

print("referenceEntityTypes:", result.referenceEntityTypes)