Model.hm_attributeidfromname#

Model.hm_attributeidfromname(attribute_name)#

Returns an attribute ID from the attribute name for the current template. If the attribute does not exist in the current template, an error is returned.

Parameters:

attribute_name (hwString) – The name of the attribute to query.

Returns:

Example#

Get the attribute ID of the OptiStruct * PSHELL_T * attribute#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributeidfromname(
    attribute_name="PSHELL_T"
)

print("id", result.id)