Selection in diagrams

Every com.nomagic.magicdraw.uml.symbols.PresentationElement can access selected elements or change their own selection status.

images/download/attachments/47117674/image2015-7-1_14_40_20.png

Collecting selected presentation elements in a diagram

Project project = ;
DiagramPresentationElement diagram = project.getActiveDiagram();
List<PresentationElement> selected = diagram.getSelected();

Selecting element in a diagram

presentationElement.setSelected(true);

Presentation element selection events page describes selection change events