Model.hm_attributelistall#

Model.hm_attributelistall(value)#

Returns a list of all attribute IDs, names, types or type names for the current template.

Parameters:

value (hwString) –

The type of list to return. Valid values are:

id - The attributes’ ID.

name - The attributes’ name.

type - The attributes’ type number.

typename - The attributes’ type string.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • Keys valid for value="name"

      • value (list of strings)

    • Keys valid for value="type"

      • value (numpy.ndarray)

    • Keys valid for value="typename"

      • value (list of strings)

    • Keys valid for value="id"

      • value (numpy.ndarray)

Examples#

List the IDs of all the attributes in the current template#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributelistall(value="id")

print("List of attrbutes' IDs:", result.value)
List the names of all the attributes in the current template#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributelistall(value="name")

print("List of attrbutes' names:", result.value)
List the type numbers of all the attributes in the current template#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributelistall(value="type")

print("List of attrbutes' type numbers:", result.value)
List the type names of all the attributes in the current template#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributelistall(value="typename")

print("List of attrbutes' type names:", result.value)