Model.assemblymodify#

Model.assemblymodify(assemblyname, collection_set, color)#

Creates or modifies an assembly.

Parameters:
  • assemblyname (hwString) – The name of the assembly.

  • collection_set (CollectionSet) – The set of collections containing possibly multiple type of entities. For now, valid entity types are components and parts (representing assemblies).

  • color (int) – The index number of the color in the HyperMesh palette.

Note

The components in the collection_set will be the only components in the assembly after this function is executed.

Example#

Create the assembly * frontend * that contains the components * fender * , * hood * , and * hoodinr * , and is colored blue , indicated by the number 9#
import hm
import hm.entities as ent

model = hm.Model()

# Creating the Collectionset
comp_col = hm.Collection(
    model, ent.Component, "Name=fender OR Name=hood OR Name=hoodinr"
)
colset = hm.CollectionSet(model)
colset.set(comp_col)

model.assemblymodify(assemblyname="frontend", collection_set=colset, color=9)