Model.hm_attributelist#

Model.hm_attributelist(entity_type, entity_id, 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_id (unsigned int) – The ID 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 ID 6#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributelist(entity_type=ent.Material, entity_id=6, value="id")

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

model = hm.Model()

_, result = model.hm_attributelist(entity_type=ent.Material, entity_id=6, value="name")

print("value", result.value)