How to Draw a UML Diagram with SmartDraw

SmartDraw is designed to help you create UML diagrams quickly and easily. You'll get ready-made templates and symbols as well as tools specifically designed to build the diagram you need.

Sign up for SmartDraw free. Works on your Mac or any other device.

Start Now

Finding the UML Symbols and Templates

SmartDraw has a number of pre-made UML templates located in the UML folder, accessible on the left hand side of the SmartDraw template browser. This is the first thing you see when you open SmartDraw. To start drawing, simply open any of SmartDraw's UML templates.

A symbol library filled with common UML symbols and notations is docked to the left of the drawing area in what's called the SmartPanel.

UML templates

Using the SmartPanel

Every UML template opens with a specialized UML SmartPanel docked to the left of the work area. This panel will guide you through creating any UML diagram by making commonly used symbols and tasks easily accessible.

UML symbols

Adding Components to Your Diagram

You can add a symbol to your drawing by selecting it in the gallery preview of the SmartPanel and then clicking anywhere on the page. This action is called stamping. You also use the traditional drag-and-drop methods to add a symbol to your diagram.

UML drag and drop

Connecting Lines to Shapes

Most UML diagrams involve connecting one or more shapes to each other using lines.

To connect two shapes, all you have to do is add the first shape, select the next shape from the library, and then click Add Right (or Add Left, Add Up, etc.) in the SmartPanel. Your shapes will be connected automatically. You can keep adding shapes in any direction, quickly and efficiently.

You can also connect two shapes manually. Once you have the shapes on your drawing area, click the Draw Lines tool. Touch one end of your cursor to the shape you're trying to connect and without letting go of the mouse drag the line to the edge of the other shape. When you see the anchor symbol, you can let go of the line and it will attach to the object.

By default the connecting line will be a segmented line or shape connector, but you can choose a straight line, a curved line, or something else from the Line Shape drop-down menu on the SmartPanel.

Adjusting Line Style
To adjust a line's style, select the line, then go to the Lines command in the Home tab. Here you can adjust the thickness, create a dashed line, or select a different color from the palette.

UML lines

Adding Arrows
By default, lines are set to be drawn with arrows if you started with a UML template. To convert any line to one with or without an arrow, select the line, then go right-click and select Arrowheads. Click on Custom for more options and choose the appropriate arrowhead for the type of relationship you want to illustrate. You can also find the same Arrowhead options under the Line menu.

UML custom arrows

Connected Shapes

Once connected, lines and shapes stay connected, even if they are moved or stretched.

To detach a line from an object it is linked to, click on the line, then pull the end knob away from the object.

If you connected your shapes using the automatic buttons on the SmartPanel, just select the shape and drag it away from the line or delete it. Your drawing with automatically readjust and heal itself.

Connected shapes

Dropping Shapes on a Line

In UML sequence diagrams, execution occurrences or activation boxes are linked to vertical lifelines. First, make sure that Allow Shapes to Link to Lines is checked under Options in the File tab.

SmartDraw shapes link to lines via a special attachment point located by default in the center of the shape. Drag the shape over the line so its center (or attachment point) is near the line. As the shape's attachment point comes in contact with the line, the cursor changes to an anchor, and the connection point appears as a black dot.

Sometimes, the shape rotates 90 degrees when it attaches to a line. To make sure that the shape retains its own angle of rotation, select the line and choose Horizontally under Text Direction command.

To break the link between a shape and a line, just drag the shape away from the line.

Dropping shapes on lines

Generalization Relationship and Finding Symbols

Generalization or inheritance relationships can be created in using one of the many software design symbols contained in SmartDraw. As with many symbols, the hard part may be finding them.

By default, the SmartPanel displays a single gallery. To find more symbols and library, click on More next to the title bar of the existing library to show drop-down menu of options. You can choose from some default UML symbol libraries or opt to search SmartDraw's entire collection by clicking on More Symbols.

Finding UML symbols

In this case, the symbol for generalization is contained in the UML library. Open it and drag or stamp the symbol to the page.

Add a symbol

Attaching Shapes to a Generalization Relationship

A generalization symbol automatically has two subtypes attached to it. You can drag additional subtype boxes to the automatic connector to attach them. The connector is a special line tool that automatically connects several shapes in evenly spaced patterns. As shapes get close to the connector, the outline of the moving object jumps to the closest link point, showing where it would connect if you released it. Releasing the mouse attaches the object to the connector at the selected link point.

Attaching shapes

Adding and Editing Text

To add text to a shape or a line, select it and start typing. Depending on the particular shape, your text will appear inside, below, or above the shape.

For a line, your text will appear centered on the line. Some shapes will already have text on them. To edit this text, double-click on the area you want to edit.

Change Text Style and Color
You can change font size, font type, color, and alignment in the Design tab.

To add text to your work area as an independent object, click on the Text tool in the ribbon above the work area or click on Add Text in the SmartPanel.

Editing text

Converting a Shape into a Table

UML objects that specify operations and attributes are depicted as rectangles with rows. You can use the symbols in the UML libraries, or you can draw your own by converting a rectangle shape into a table.

To convert a rectangle, select it, then go to the Table tab and choose the number of columns and rows you want and click Insert Table.

Convert to a table

Once your shape is converted, you can use the standard Table menu commands to change a cell's background color as well as the grid line thickness and color. You can also Join and Split cells to further customize your shape. To enter text into a cell, double-click on it and type.

UML class

If you want even more freedom in editing these symbols, you can group or ungroup them in the Design tab.

Once a symbols are grouped you can stretch to grow them as a single unit.

If you ungroup a symbol, you can stretch, shrink, and grow the elements of a symbol separately and reassemble them to your liking.


Arranging Objects

You can arrange objects on your page by selecting them and moving them with the mouse. For finer adjustments you can use the arrow keys to nudge the object or objects into place. The Design tab provides a variety of helpful commands that help you position your objects better.

For example, to align a number of class objects to each other, first, select the objects you want to arrange. Do this by clicking on each object in turn (while holding down the Shift key).

The last object you click has black selection handles and is called the Target Object. When you use the Align or Make Same Size commands, all the selected objects will be aligned or sized to match the target object.

Arrange objects
Align objects
Make the same size

Arranging Objects Vertically

You can think of the objects in your drawing as a vertical stack of blocks. Objects drawn earlier are on the bottom of the stack while objects drawn later are at the top of the stack. The object drawn last is the shape that's on top.

If a recently drawn object like a loop on a sequence diagram covers parts of your drawing, you can go to the Fill command under the Home tab and set the opacity to 0%. Alternatively, you can go to the Design tab and choose Send to Back to change the order of the stack.

Set to transparent
Send to back
Fixed loop

Rotating Objects

Although most software diagrams have a horizontal layout, there might be cases where you will need objects to be at an angle. Most objects have a rotating handle near their right edge. To rotate an object manually, move your cursor over the handle until it changes into a circular arrow, click down with the mouse, and rotate. When finished rotating, release the mouse to see the rotated object.

Rotating images

When on object is too small to have a rotator handle or you want to rotate it more precisely, select the object, go to the Design tab, and using the Rotate command, specify the exact angle of rotation within one tenth of a degree.

You can rotate straight lines, any shape, and even most imported items. However, you cannot rotate segmented lines, curves, automatic connectors, and bit maps. Objects also don't rotate when linked. To rotate a hooked element, such as the initial and final state symbols, first unhook it and reattach it only after it's been rotated.