Model.attributeupdatestring#

Model.attributeupdatestring(entity, identifier, solver, status, behavior, value)#

Updates an attribute of type string (hwString()).

Parameters:
  • entity (Entity) – The object describing the entity that owns the attribute.

  • identifier (int) – The identifier of the attribute.

  • solver (int) – The solver number of the attribute.

  • status (int) – The status of the attribute.

  • behavior (int) – The behavior of the attribute.

  • value (hwString) – The value of the attribute.

Example#

Update the load collector with ID 74 in * IMPERF_TYPE * dataname (identifier=11340 ) in Optistruct profile by set attribute to * GRID *#
import hm
import hm.entities as ent

model = hm.Model()

# Finding the IMPERF_TYPE identifier using the hm_attributeidentifier function
_, r = model.hm_attributeidentifier(
    entity_type=ent.Loadcol, entity_id=74, attribute_name_or_id="IMPERF_TYPE"
)

# Setting the dataname
model.attributeupdatestring(
    entity=ent.Loadcol(model, 74),
    identifier=r.id,
    solver=1,
    status=2,
    behavior=0,
    value="GRID",
)