Archi Forum

Archi => General Archi Discussion => Topic started by: jmariani on October 06, 2016, 21:30:42 PM

Title: Copy elements between models
Post by: jmariani on October 06, 2016, 21:30:42 PM
Hi.

Any way to copy elements between models?

Use case: I have a model which is a repository of patterns and common elements, and I want to copy from this one to a new model (i.e, views, application components, etc.)

TIA!
Title: Re: Copy elements between models
Post by: Phil Beauvoir on October 06, 2016, 22:21:27 PM
Hi,

not at the moment!

(I know this is a much requested feature)

Phil
Title: Re: Copy elements between models
Post by: Hervé on October 07, 2016, 15:44:07 PM
Hi,

Here is the solution I suggest, using my database plugin (available on GitHup https://github.com/archi-contribs/database-plugin (https://github.com/archi-contribs/database-plugin)) :

And voila !


But be careful, if you move an element to another project and if this element is still referenced in a view, then your model will be corrupted. This is something I'm working on (in fact, that's the only point that avoids me to pass my plugin in release 1.0) but at the moment I recommand to be very careful with moves.

Anyway, as your request is about copying elements, there are not such risks ...

Hope this helps.

Best regards
Hervé

Title: Re: Copy elements between models
Post by: Jean-Baptiste Sarrodie on October 09, 2016, 21:46:03 PM
Hi,

In fact this is possible (and easy) using the grafico plugin. A more advanced version has been described here: https://github.com/archi-contribs/archi-grafico-plugin/wiki/Merge-two-(or-more)-models

In short, your export your source and target models using the grafico plugin in two separate directory, then you just copy paste the xml files associated with the elements/relationships/views from the source to the target. An easy way to find which files to copy is to juste remove anything else from the source model, so this basically become a merge (as described in the url above).

Regards,

JB