Model.hm_modent_getchildren#

Model.hm_modent_getchildren(entity, subsystems_collection, recursive)#

Populates an empty collection with hierarchical children subsystem entities of a parent subsystem entity.

Parameters:
  • entity (Entity) – The object describing the subsystem entity.

  • subsystems_collection (Collection) – The output collection to be populated with the children subsystem entities.

  • recursive (bool) –

    0 - Return only the first level of hierarchical children.

    1 - Return all levels of hierarchical children.

Returns:

Example#

Populate the output (output_col) collection object with all children of subsystem ID 2#
import hm
import hm.entities as ent

model = hm.Model()

output_col = hm.Collection(model, ent.Subsystem, populate=False)

model.hm_modent_getchildren(
    entity=ent.Subsystem(model,2), subsystems_collection=output_col, recursive=1
)