Model.hm_attributesolverarrayvalues_byentityname#

Model.hm_attributesolverarrayvalues_byentityname(entity_type, entity_name, attribute_name)#

Returns the solver code and all values for a 1D array attribute on an entity. The function first searches to find the specified attribute for the current template. If the attribute is not found for the current template, the search can be extended to search all attributes assigned to the entity. If the attribute does not exist on the entity, an error is returned.

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

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

  • attribute_name (hwString) – The name of the attribute to query. If a name is specified, the attribute must exist in the current template.

Returns:

Example#

Get the solver code and all values of the 1D array for the attribute with name “ Example “ on material withname “ mat1 “ , consider all attributes#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributesolverarrayvalues_byentityname(
    entity_type=ent.Material, entity_name="mat1", attribute_name="Example"
)

print("Solver Code:", result.solverCode)
print("values", result.values)