You can create the Containment tree when drawing more than one Containment relationship. ![MagicDraw 19.0 LTR > Containment Tree > containment_tree.png](/download/attachments/36312884/containment_tree.png?version=1&modificationDate=1501590099547&api=v2)
Example of several containment relationships (on the left) and example of containment tree (on the right)
To group containment paths into a tree
- Draw a Containment path from each contained element to the containing element.
- Now, do one of the following:
- Through the diagram pane.
- Select the Containment relationship.
- Click and hold the little square (the end of the Containment path) next to the Containment end with the circle plus symbol.
- Drag and drop the selected Containment end on the other Containment path.
- While dragging, the Containment path turns blue, indicating an allowable connection. Containment paths merge together.
![MagicDraw 19.0 LTR > Containment Tree > DnD_containment_path.png](/download/attachments/36312884/DnD_containment_path.png?version=1&modificationDate=1501590174417&api=v2)
- Through the shortcut menu.
- Open the shortcut menu of the containing element, in the example above: Domain.
- Click Refactor > Make Sub Tree.
To ungroup a containment tree
- Right-click the Containment tree's end with the circle plus symbol pointing to a containing element.
- In the opened shortcut menu, click the Ungroup Tree command.
![MagicDraw 19.0 LTR > Containment Tree > ungroup_containment_tree.png](/download/attachments/36312884/ungroup_containment_tree.png?version=1&modificationDate=1501590230970&api=v2)
To separate the containment path from the containment tree
|