Model.hm_attributelist_byentityname#

Model.hm_attributelist_byentityname(entity_type, entity_name, value)#

Returns a list of all attribute IDs or names assigned to a specific entity for the current template.

Parameters:
  • entity_type (EntityFullType) – The type of entity to query.

  • entity_name (hwString) – The name of the entity.

  • value (hwString) –

    The type of list to return. Valid values are:

    id - List with attribute IDs.

    name - List with attribute names.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • Keys valid for value="id"

      • value (numpy.ndarray)

    • Keys valid for value="name"

      • value (list of strings)

Examples#

List the attribute IDs for the current template assigned to material with name “ mat1 “#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributelist(entity_type=ent.Material, entity_name="mat1", value="id")

print("value", result.value)
List the attribute names for the current template assigned to material with name “ mat1 “#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributelist(entity_type=ent.Material, entity_name="mat1", value="name")

print("value", result.value)