Model.attributeupdateintarray2d#

Model.attributeupdateintarray2d(entity, identifier, solver, status, behavior, data)#

Updates an attribute of type 2D integer array.

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.

  • data (hwIntList2) – The 2D array of integers.

Example#

Update the load collector with ID 48 in * PEAKOUT_CID_ARRAY2D * dataname (identifier=2311 ) in Optistruct profile by set attribute to [ [ 1 , 2 ] , [ 4 , 5 ] , [ 6 , 7 ] ]#
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.attributeupdateintarray2d(
    entity=ent.Loadcol(model, 48),
    identifier=r.id,
    solver=1,
    status=2,
    behavior=0,
    data=[[1, 2], [4, 5], [6, 7]],
)