Model.attributeupdateentityidarrayelementmark#

Model.attributeupdateentityidarrayelementmark(collection, identifier, solver, status, behavior, target_entity, index, value)#

Updates one element of an attribute of type 2D entity ID 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.

  • target_entity (EntityFullType) – The type of entity to which the attribute refers.

  • index (int) – Index into the array (first index is zero).

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

Example#

Update the load collector with ID 14 , 78 in * CNVGADD_CONVGID * dataname (identifier=718 ) in Optistruct profile by set the load collectors with ID 5#
import hm
import hm.entities as ent

model = hm.Model()

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

# Setting the dataname
model.attributeupdateentityidarrayelementmark(
    collection=hm.Collection(model,ent.Loadcol,[14, 78]),
    identifier=r.id,
    solver=1,
    status=2,
    behavior=0,
    target_entity=ent.Loadcol,
    index=0,
    value=5,
)