|Copy Diagram from a model to another programmatically [message #1777889]
||Tue, 05 December 2017 16:08
| Yoann Farré
Registered: November 2017
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.
Powered by FUDForum
. Page generated in 0.02234 seconds