Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Copy Diagram from a model to another programmatically
Copy Diagram from a model to another programmatically [message #1777889] Tue, 05 December 2017 16:08
Yoann Farré is currently offline Yoann FarréFriend
Messages: 144
Registered: November 2017
Senior Member

I would use a template model (located in a plugin) to copy some elements including diagrams (and elements in diagrams) in an other model (work model). The idea is to pick in the template to include automatically new elements in the work model after an action of the user.

I obtained something working for semantic UML elements and stereotyped elements (see here :
I also can rename elements to be more adapted to the work model.

But now, I would copy a diagram (located in the template model) and make that the new diagram refer to the newly copied elements. For the moment, I only can obtain a new diagram which refers to the elements of template, which is not very relevant.

I tried several ways including:
- duplicate the diagram and copy its owned elements similarly to the DuplicateDiagramCommand
- reuse the code of copy/paste action in model explorer but the result was not very positive... and I don't feel comfortable with Copy and Paste Strategies.

Could someone help me with this issue, please? Maybe indicate some part of the Papyrus code because there are a lot of class in charge of duplication or copy?

Thank you for reading.


Previous Topic:Viewpoint configuration question in Neon.3
Next Topic:Papyrus Neon (2.0.X) RCP
Goto Forum:

Current Time: Wed Jul 15 12:24:02 GMT 2020

Powered by FUDForum. Page generated in 0.01862 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top