Add Shape Scripts

How to:

To add a Shape Script to a stereotype in a UML Profile (such as an MDG Technology Stereotype Profile), follow the steps below:



See Also


On the Profile Package child diagram, select a Stereotype element



Right-click on the element and select the Attributes context menu option



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



Click on the (  ...  ) button next to the Initial field

The Shape Editor dialog displays

Shape Editor


Enter the Shape Script in the Shape Editor dialog

Click on the OK and Close buttons


In some cases, particularly MDG Technology Stereotype Profiles, 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.

The Stereotype element now resembles the example below:



  • 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

Learn More: