Model.createcollectorforpartiallycontained#

Model.createcollectorforpartiallycontained(collection, name, config=0, type=0, reserved=0)#

Creates a collector and moves certain entities into the collector.

Parameters:
  • collection (Collection) – The collection containing the input entities. Valid entities are elements, loads, systems and vectors

  • name (hwString) – The new collector name. The collector type is determined by the type of entities of the collection.

  • config (int) – Set to a valid config value to specify if only entities of that config should be moved. Otherwise, set to 0. Currently only supported for elements.

  • type (int) – Set to a valid type value to specify if only entities of that type should be moved. Otherwise, set to 0. Currently only supported for elements.

  • reserved (int) – Reserved for future development. Must be set to 0.

Examples#

Create a component named “comp2” and move elements with IDs 1-100#
import hm
import hm.entities as ent

model = hm.Model()

model.createcollectorforpartiallycontained(
    collection=hm.Collection(model, ent.Element, list(range(1, 101))),
    name="comp2",
    config=0,
    type=0,
    reserved=0,
)
Create a component named “ comp2 “ and move only quad elements from elements 1-101#
import hm
import hm.entities as ent

model = hm.Model()

model.createcollectorforpartiallycontained(
    collection=hm.Collection(model, ent.Element, list(range(1, 101))),
    name="comp2",
    config=104,
    type=0,
    reserved=0,
)