Model.hm_attributeidentifier_byentityname#

Model.hm_attributeidentifier_byentityname(entity_type, entity_name, attribute_name_or_id)#

Returns the identifier flag of an attribute on an entity for the current template. If the attribute does not exist on the entity, or is not an attribute from the current template, an error is returned.

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

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

  • attribute_name_or_id (hwString) – The name or ID of the attribute to query. The attribute must be in the current template.

Returns:

Example#

Get the attribute entity type number of the entity attribute with name * LSD_CID * on property with name “ prop1 “ for the LS - DYNA template#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributeidentifier_byentityname(
    entity_type=ent.Property, entity_name="prop1", attribute_name_or_id="LSD_CID"
)

print("id", result.id)