Model.attributeupdate_entityidarray2d_mark#

Model.attributeupdate_entityidarray2d_mark(collection, identifier, solver, status, behavior, target)#

Updates an attribute, which is a 2D array (list) of entity lists (EntityList2()), on a set of entities.

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.

  • target (EntityList2) – The list of entity lists to which the attribute refers.

Example#

Update the load collectors in * FLLWER_LSID_ARRAY2D * dataname (identifier=10086 ) in Load collector with ID 24 , 75 in Optistruct profile#
import hm
import hm.entities as ent

model = hm.Model()

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

loadcol_collection = hm.Collection(model, ent.Loadcol, [24, 75])
newloadcolsList = [
    [ent.Loadcol(model, 22), ent.Loadcol(model, 14)],
    [ent.Loadcol(model, 18), ent.Loadcol(model, 41)],
]
# Setting the dataname
model.attributeupdate_entityidarray2d_mark(
    collection=loadcol_collection,
    identifier=r.id,
    solver=1,
    status=2,
    behavior=0,
    target=newloadcolsList,
)