Model.hm_attributesolverarrayvalues_byentityid#
- Model.hm_attributesolverarrayvalues_byentityid(entity_id, attribute_id, extend_search=0)#
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_id (Entity) – The object describing the entity to query.
attribute_id (int) – The ID of of the attribute to query.
extend_search (int) –
By default, the attribute will only be searched for the current template. However, the search can be extended to search all attributes assigned to the entity. Valid values are:
0 - Search only attributes for the current template on the entity.
1 - Search all attributes on the entity.
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:solverCode (int)
values (list of strings)
Example#
Get the solver code and all values of the 1D array for the attribute with ID 100 on material with ID 6 , consider all attributes#import hm import hm.entities as ent model = hm.Model() _, result = model.hm_attributesolverarrayvalues_byentityid( entity_id=ent.Material(model, 6), attribute_id=100, extend_search=1 ) print("Solver Code:", result.solverCode) print("values", result.values)