Model.parametrize_bycollection#

Model.parametrize_bycollection(collection, identifier, parameter_entity)#

Assigns a parameter to a dataname of a collection.

Parameters:
  • collection (Collection) – The collection containing the entities to assign the parameter.

  • identifier (hwString) – The name of the entities’ identifier (dataname).

  • parameter_entity (Entity) – The object defining the parameter entity.

Example#

Assign parameter with ID 1 to young modulus of all materials#
import hm
import hm.entities as ent

model = hm.Model()

mat_collection = hm.Collection(model, ent.Material)

model.parametrize_bycollection(
    collection=mat_collection, identifier="E", parameter_entity=ent.Parameter(model, 1)
)