    

 ## On this page

  

 

 # addAssembly2

 Last update: 30.07.2026 

public [addAssembly2](add-assembly2.md)(name: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), xPos: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), yPos: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)): [Assembly](index.md)

adds a sub-assembly

#### Return

the new assembly

#### Parameters

namethe new assembly namexPosx-coordinate to add the assembly at (in its parent area)yPosy-coordinate to add the assembly at (in its parent area)#### Throws

[ModelCenterException](./../-model-center-exception/index.md)public [addAssembly2](add-assembly2.md)(name: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), xPos: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), yPos: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), assemblyType: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)): [Assembly](index.md)

adds a sub-assembly of the specified type

#### Return

the new assembly

#### Parameters

namethe new assembly namexPosx-coordinate to add the assembly at (in its parent area)yPosy-coordinate to add the assembly at (in its parent area)assemblyTypethe type of assembly to create:ASSEMBLY\_TYPE\_ASSEMBLY - traditional ModelCenter assemblyThe following additional assembly types are available in ModelCenter process models(i.e. modelType == MODEL\_TYPE\_PROCESS)ASSEMBLY\_TYPE\_SEQUENCE - sequential flowASSEMBLY\_TYPE\_IF - if-then-else flowASSEMBLY\_TYPE\_FOR\_EACH - loop over a data array#### Throws

[ModelCenterException](./../-model-center-exception/index.md)