Book a Demo
Prev Next

Move Elements Within Diagrams

As you add new elements to a diagram, you might want to move the existing elements to create more space, make a structure more apparent, or create a nesting relationship between two elements. There are several ways in which you can move the elements within the diagram.

Move Elements

Image

Action

See also

Change Position

Select an element or group of elements in the diagram, then:

  • Use the mouse to drag the element or group of elements to the required position (the cursor switches to the four-arrow icon as shown)
  • Hold down Shift and press the appropriate arrow keys to move the element or group of elements by small increments in the arrow direction

If you are moving a single element and you have selected the 'Layout > Alignment > Snap to grid > Smart Placement' and 'Show smart placement guide' options, as you move the element colored lines will display around the element. These indicate the positions of the edges and edge-centers as they align with an adjacent element or connector. Note that the objects must be contemporary - not at different hierarchical levels and not in different partitions of the diagram.

Move Elements In Diagram Sections

Align Elements

Select a group of elements in the diagram and align them on the last-selected element using:

  • The 'Align...' options in the right-click context menu or
  • The Alignment buttons on the Diagram toolbar

    Align Toolbar
Operations on Multiple Elements Diagram Toolbar

Confirm Possible Nest Elements

If you want to nest one element within another, you can drag that element onto the 'nest' element; the nesting element is then always encapsulated by the nest and moved within the nest.

Not all element combinations are valid. For example:

  • Drag a Signal element over a Class; because a Class element can nest a Signal, the Signal element is encapsulated
  • Drag a Class element over a Signal element; because a Signal cannot nest a Class, the Class element is not encapsulated

To confirm that the proposed nest element is able to accept the selected nesting element, observe the nest element border as you drag the nesting element over it:

  • If the nest element can accept the selected element, the nest element border changes to a dashed line
  • If the border does not change, the selected element cannot be encapsulated within the nest element

Notes (on Adding nesting element to nest)

  • The 'Support for Composite Objects' checkbox must be selected on the 'Objects' page of the 'Preferences' dialog (select the 'Start > Appearance > Preferences > Preferences' ribbon option and click on the 'Objects' page); if this option is not selected, the dashed border does not show and the nesting element cannot be embedded on the nest element in the diagram
  • Both elements must already exist on the diagram; the nest element border does not change if you drag a potential nesting element over it from the Toolbox or Browser window
  • The nesting element must be dragged right over the nest element, so that its borders are completely within the nest element borders
  • The Z-order of the nesting element is automatically adjusted so that it is not hidden by the nest element
  • When you embed a nesting element on its nest element, the nesting element becomes part of the nest element hierarchy in the Browser window; if you drag the nesting element out of the nest element, the nesting element becomes independent and is no longer embedded in the nest element hierarchy

Element Alignment Facilities

There are two distinct element alignment facilities provided by Enterprise Architect,  known as 'Standard Grid' and 'Smart Placement'.  These facilities assist in aligning, sizing and spacing elements on your diagrams, so you can quickly and easily produce aesthetically pleasing layouts.

Click on the 'layout grid' icon , to display a drop-down menu for enabling the Standard Grid or Smart Placement facilities, and for setting various options relating to those facilities.  The options are described below.

You cannot operate both Standard Grid and Smart Placement at the same time.  You can choose one, or the other, or neither.

Standard Grid Options

The Standard Grid facility is designed to enhance the precision and alignment of elements in diagrams or design interfaces. When enabled, this facility ensures that when positioning elements on the diagram, their edges automatically 'snap' to the nearest grid point as they are moved or resized. This helps maintain consistent spacing and alignment, making it easier to organize elements neatly without having to manually adjust their positions.

Option

Description

Enable

Select this checkbox to Enable the 'Snap to Grid' facility.

(Enabling Standard Grid will disable Smart Placement.)

Show Grid

Select this checkbox to display a grid of light gray dots over the background of the diagram.

Note:  It is not necessary to display the grid dots in order to use the Snap to Grid facility.

Smart Placement Options

When enabled, the Smart Placement facility causes edges or mid-points of elements that are being moved or resized, to 'snap to position' to align with the edges or mid-points of nearby elements.  It can also 'snap to position' such that element sizes and spacing are equal.

When the option to display guidelines is enabled, as elements are moved or resized, lines are drawn on the diagram indicating which 'snapping feature' will take effect.

Option

Description

Enable

Select this checkbox to Enable the Smart Placement facility.

(Enabling Smart Placement will disable Standard Grid.)

Multi Select

Select this checkbox to enable Smart Placement of the 'bounding rectangle' that encloses a group of selected elements.  The bounding rectangle will snap to the edges and centerlines of nearby non-selected elements, as the selected elements are moved across the diagram.

Resizing is not supported for multiple selection, so the Same Size option will have no effect when multiple objects are selected.

Show Guides

Select this checkbox to enable the display of Smart Placement guidelines on the diagram as elements are being moved or resized.

Guidelines will only be displayed between objects that are on the same hierarchical level and within the same partition of the diagram.

Note:  It is not necessary to have 'Show Guides' enabled for the Smart Placement facility to take effect.

Element Bounds

Select this checkbox to enable snapping of the position of an element being moved, to align with the position of other nearby objects.  When moving an object, its position will 'snap', such that horizontal edges (top or bottom) and centerlines, will align with horizontal edges and centerlines of other objects.  Similarly, vertical edges and centerlines will also snap into position.  If Show Guides is enabled, lines are displayed indicating which edges or centerlines are being matched.

You may wish to deselect this option, to prevent too many guidelines from displaying at once, when you want to simply space out elements with the Relative Spacing option or adjust sizes with Same Size option.

Same Size

Select this checkbox to enable snapping to the same size as other objects within the visible area.  When resizing an element, the moving edge will snap into place when it reaches the same width, height or both of another object.  If Show Guides is enabled, lines are displayed indicating which dimensions on which objects are being matched.

Resizing is not supported for multiple selection, so the Same Size option will have no effect when multiple objects are selected.

Relative Spacing

Select this checkbox to enable snapping of the position of an element being moved, when its spacing to a nearby object, matches the spacing between other objects in the visible area. If Show Guides is enabled, lines are displayed indicating which object spacing is being matched.

(Eg: when moving Class3, it will snap into position when Class3 is at the same distance from Class1 as Class1 is from Class2).

Mid Points

Select this checkbox to enable snapping of the position of an element being moved, when its position is midway, either horizontally or vertically, between two other objects on the diagram, provided the positions do not overlap.  If Show Guides is enabled, lines are displayed indicating that the object being moved is midway between two other objects.

(Eg: Moving ClassA between the objects ClassB and ClassC will cause it to snap to a point that is midway between both of those objects as long as they aren't overlapped and there's enough space for ClassA to fit between them).

Learn more