Model.attributeupdateintarray2dmark#

Model.attributeupdateintarray2dmark(collection, identifier, solver, status, behavior, data)#

Updates an attribute of type 2D integer array on a set of entities.

Parameters:
  • collection (Collection) – The collection containing the entities to update their attributes.

  • 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 ints.

Example#

Update the load collectors with ID 48 , 82 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.attributeupdateintarray2dmark(
    collection=hm.Collection(model, ent.Loadcol, [82, 48]),
    identifier=r.id,
    solver=1,
    status=2,
    behavior=0,
    data=[[1, 2], [4, 5], [6, 7]],
)