Model.attributeupdateentityidarray#

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

Updates an attribute that is an array of entity IDs.

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.

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

  • data (hwUIntList) – An array of IDs to entities which will be set to the attribute.

Example#

Update the load collector with ID 14 in * CNVGADD_CONVGID * dataname (identifier=718 ) in Optistruct profile by set the load collectors with IDs 20 , 21 , 22#
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.attributeupdateentityidarray(
    entity=ent.Loadcol(model, 14),
    identifier=r.id,
    solver=1,
    status=2,
    behavior=0,
    targetentity=ent.Loadcol,
    data=[20, 21, 22],
)