Model.attributeupdateintarray2delementmark#

Model.attributeupdateintarray2delementmark(collection, identifier, solver, status, behavior, row, col, value)#

Updates one element of an attribute of type integer array.

Parameters:
  • collection (Collection) – The collection containing the entities 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.

  • row (int) – The row number the value to be changed resides in (first row is zero).

  • col (int) – The column number the value to be changed resides in (first column is zero).

  • value (int) – The new value of the 2D array element.

Example#

Update the load collectors with ID 48 , 82 in * PEAKOUT_CID_ARRAY2D * dataname (identifier=2311 ) in 2nd row , 2nd column in Optistruct profile by set attribute to 3#
import hm
import hm.entities as ent

model = hm.Model()
# Finding the PEAKOUT_CID_ARRAY2D identifier using the hm_attributeidentifier function
_, r = model.hm_attributeidentifier(
    entity_type=ent.Loadcol, entity_id=48, attribute_name_or_id="PEAKOUT_CID_ARRAY2D"
)

# Setting the dataname
model.attributeupdateintarray2delementmark(
    collection=hm.Collection(model, ent.Loadcol, [82, 48]),
    identifier=r.id,
    solver=1,
    status=2,
    behavior=0,
    row=1,
    col=1,
    value=2,
)