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

Add Shape Scripts

UML elements and connectors each have a standard appearance, in terms of shape, color and labeling. It is possible to change the appearance of a type of element or connector in a number of ways, using a Shape Script to define the exact feature you want to impose on the default - or main - shape. If you want to standardize the appearance, to apply to many elements, you attach the Shape Script to an attribute of a Stereotype element in a UML Profile (such as an MDG Technology Stereotype Profile).

Access    Profile Stereotype element: ( F9 ) > General | Initial Value: browse

Add a Shape Script to a Stereotype element



See also


In the Attributes Properties dialog, in the Name field, type _image.




Click on the button next to the Initial Value field.

The Shape Editor dialog displays.


Shape Editor


Enter the Shape Script in the Shape Editor dialog.

Click on the OK button and then the Close button.


Write Scripts


The Stereotype element now resembles this example:




Your Shape Script might include externally-defined images; in this case the Shape Script would include the image method, specifying the image file name prefixed with the technology name
If you are creating a Shape Script for an Association Class, be aware that the Shape Script is applied to both the Class part and the Association part; therefore, you might have to include logic in the shape main that tests the type of the element so that you can give separate drawing instructions for Class and for Association
Such logic is not necessary in the:
shape source or shape target, which are ignored by Classes, or the
decoration shapes which are ignored by Associations
You can also apply Shape Scripts to elements on an ad hoc basis, attaching the Shape Script to a stereotype defined on the UML Types dialog (Settings > UML Types)

Learn more