Model.hm_modent_getentityparent#

Model.hm_modent_getentityparent(entity, parent_entity_type)#

Returns the hierarchical subsystem entity parent of a specific entity.

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

  • parent_entity_type (EntityFullType) – The type of parent entity to query. Valid entity types are subsystemconfigurations, subsystems, and subsystemsets.

Returns:

Example#

Return the parent subsystem of component with ID 1000#
import hm
import hm.entities as ent

model = hm.Model()

_,result = model.hm_modent_getentityparent(
    entity=ent.Component(model, 1000),#
    parent_entity_type=ent.Subsystem
)

print("parentEntity", result.parentEntity)