How to access a specific diagram

I create a menu following this tutorial and it works.

Now I would like access a specific diagram by clicking on this menu with an element selected (or the diagram). I know how to access all diagrams but not this specific one.

Here is how I would like to access a diagram by selecting it:

Here is how I would like to access a diagram by selecting one of his element:

Thank you,
Nbranas.

Hi,

By following the referenced tutorial you have created a CommandHandler. In the CommandHandler code you have the selection object containing the objects from which the menu has been open. Depending on the kind of object, whether it is a Diagram or an EObject from the Capella Project Explorer, or a DDiagramElement from the diagram you should then be able to navigate to the parent Diagram.

I think, the API you are looking for are located in the DialectManager and SessionManager.

Regards,
Arnaud