Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.


Shapes can contain - and be composed of - other shapes.

Subshape Layout

To set the layout type, the layoutType attribute must be set in the initialization attributes section of the script; in other words, before any of the methods are called. Valid values for this attribute are:


Shapes with leftright layout position subshapes side by side, with the first added on the left, and subsequent subshapes to the right.


TopDown places subshapes in a vertical arrangement, with the first shape added to the top and subsequent shape added below.


Border layout requires an additional argument to the addsubshape method to specify which region of the containing shape the subshape is to occupy: N, E, S, W or CENTER. Each region can only be occupied by one subshape.

A subshape that is assigned to the E or W region must have its preferredwidth attribute specified in its declaration. Similarly, subshapes added to N or S must have their preferredheight attribute set. In this case, the values for these attributes are treated as static lengths and do not scale glyphs.


For example:

shape main










       shape sub







The above script provides the following shape:

subshape example