Model.assemblymodifyhierarchy#

Model.assemblymodifyhierarchy(assemblyname, collection_set, color)#

Adds 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.

Example#

Add an assembly * frontend * that contains the components * fender * , * hood * , and * hoodinr * , assebmly engine 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"
)
assebmly_col = hm.Collection(model, ent.Part, ["engine"])
colset = hm.CollectionSet(model)
colset.set(comp_col)
colset.set(assebmly_col)

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