Copy Elements Between Diagrams

215 views
Skip to first unread message

Charly78

unread,
Apr 15, 2015, 5:46:32 AM4/15/15
to sparx-enterprise-archite...@googlegroups.com
Hello

I'm using EA v.12. I'm trying to copy an element to paste it as a new element in a different diagram. I want to create the new element with all the connectors of the original one. When EA display the box "Paste elemen(s) as new" I check the option include connectors. Doing that EA only creates the generalization connectors. My problem is that in the original element there are other kind of connectors (dependency,associations..) and EA doesn't copy these connectors in the new element. Any idea why or how to do that?

Thanks

[original message]

qwerty

unread,
Apr 15, 2015, 6:06:04 AM4/15/15
to sparx-enterprise-archite...@googlegroups.com
IIRC you need to copy all the related elements in one bunch. (Funny to see almost the same question the same day). Though YMMV any object is independent from its classifier. Creating an object model means you focus on a certain real life aspect. And that does not necessarily mean you will need all relations from the classifiers. Putting in the relevant ones manually seems desirable.

q.

[original message]

Charly78

unread,
Apr 15, 2015, 7:36:43 AM4/15/15
to sparx-enterprise-archite...@googlegroups.com
Thank you for your answer
I don't want to copy part of a diagram, just only one element. What I need it is a copy of an existing element (same atributtes, tags values...) and the same connectors without duplicating the objects where these connectors are pointing. I can do it manually creating all of them one by one, but if you have a element  in a model with 30 definition or asiciation  connectors it is a really hard job to do that.

[original message]

Vega@localhost Modesto Vega

unread,
Apr 15, 2015, 7:45:51 AM4/15/15
to sparx-enterprise-archite...@googlegroups.com
I don't think there is a way to do what you are after, at least I haven't found a way to do it. You can copy and a paste and element but any dependencies and associations will be lost because one of the 2 elements in the relationships is a different element in the new diagram.

It will be nice if a diagram could be copied and an element within the diagram replaced with a new element preserving similar relationships.

[original message]

qwerty

unread,
Apr 15, 2015, 8:16:18 AM4/15/15
to sparx-enterprise-archite...@googlegroups.com

54565D5C4A4D56174F5C5E58390 wrote:
It will be nice if a diagram could be copied and an element within the diagram replaced with a new element preserving similar relationships.

To me that sounds like some very local use. Anyhow, a little script can do that  for you.

q.

[original message]

Vega@localhost Modesto Vega

unread,
Apr 17, 2015, 8:56:59 AM4/17/15
to sparx-enterprise-archite...@googlegroups.com

595F4D5A5C51280 wrote:
[quote author=54565D5C4A4D56174F5C5E58390 link=1429090358/0#3 date=1429097960]It will be nice if a diagram could be copied and an element within the diagram replaced with a new element preserving similar relationships.

To me that sounds like some very local use. Anyhow, a little script can do that  for you.

q.[/quote]
It is not local for the modelling I do: data modelling. There are a lot of recurring patterns, in particular when modelling entities at different level of granularity :)

Is this the best reference for scripting in EA https://leanpub.com/ScriptingEA?

[original message]

qwerty

unread,
Apr 17, 2015, 4:16:55 PM4/17/15
to sparx-enterprise-archite...@googlegroups.com
Humbly speaking, yes  ;) To my knowledge it's the only one. My readers are happy so far I guess as I got just positive feedback.

q.

[original message]

VKN

unread,
Apr 19, 2015, 8:06:19 PM4/19/15
to sparx-enterprise-archite...@googlegroups.com

55575C5D4B4C57164E5D5F59380 wrote:
It will be nice if a diagram could be copied and an element within the diagram replaced with a new element preserving similar relationships.

If you just need to copy/paste a diagram with a new set of similar elements and connectors, it can be done:
  • Right click on the diagram in the Project Browser
  • Select Copy/Paste | Copy Diagram
  • Right click on another package and select Copy/Paste | Paste Diagram
  • Select 'Deep' on the Copy Diagram dialog and click OK

[original message]

Vega@localhost Modesto Vega

unread,
Apr 20, 2015, 7:56:47 AM4/20/15
to sparx-enterprise-archite...@googlegroups.com

4A57521C0 wrote:
[quote author=55575C5D4B4C57164E5D5F59380 link=1429090358/0#3 date=1429097960]It will be nice if a diagram could be copied and an element within the diagram replaced with a new element preserving similar relationships.

If you just need to copy/paste a diagram with a new set of similar elements and connectors, it can be done:
  • Right click on the diagram in the Project Browser
  • Select Copy/Paste | Copy Diagram
  • Right click on another package and select Copy/Paste | Paste Diagram
  • Select 'Deep' on the Copy Diagram dialog and click OK
[/quote]
This is helpful, I wasn't aware of it. The only problem with it is that it creates a copy of all elements in the diagram. The feature I am after is more complex, I am looking for some elements to be copied but others to be kept as they are.

[original message]

VKN

unread,
Apr 20, 2015, 7:55:15 PM4/20/15
to sparx-enterprise-archite...@googlegroups.com

32303B3A2C2B3071293A383E5F0 wrote:
The feature I am after is more complex, I am looking for some elements to be copied but others to be kept as they are.

This can be possible only if both source and the target elements of the connectors are selected on the diagram, copied (ctrl+c) and pasted (ctrl+shift+v) on another diagram.

[original message]

Charly78

unread,
Apr 30, 2015, 7:26:02 AM4/30/15
to sparx-enterprise-archite...@googlegroups.com
I copy here the solution that Sarp System has given to my problem:
  • Copy the element which you want to duplicate, then paste it onto a diagram using the right click "Paste Element(s) as Link" option

  • Use the right click "Insert Related Elements" option to add all the linked elements to the diagram also

  • Right click the element and select "Convert Linked Element to Local Copy"

  • You now have a new copy of the element, with all the same connectors as the original

I don't know if this solution is also useful for you Modesto.

Regards

[original message]

Vega@localhost Modesto Vega

unread,
Apr 30, 2015, 8:35:42 AM4/30/15
to sparx-enterprise-archite...@googlegroups.com

505150130 wrote:
  • Right click the element and select "Convert Linked Element to Local Copy"

  • You now have a new copy of the element, with all the same connectors as the original

I don't know if this solution is also useful for you Modesto.

Regards

Which version/edition of EA, when I right click I cannot see  "Convert Linked Element to Local Copy".

[original message]

ken.norcross

unread,
Apr 30, 2015, 10:06:12 AM4/30/15
to sparx-enterprise-archite...@googlegroups.com
in V12 it is a sub-menu below the "Advanced" menu on the right click pop up menu

right click=>advanced=>convert...

[original message]

Charly78

unread,
Apr 30, 2015, 10:56:11 AM4/30/15
to sparx-enterprise-archite...@googlegroups.com
It is true that This point is not very clear

In EA 12 is as ken.norcross says and in EA 11 is exactly the same

[original message]

Vega@localhost Modesto Vega

unread,
Apr 30, 2015, 11:36:16 AM4/30/15
to sparx-enterprise-archite...@googlegroups.com

5C5D5C1F0 wrote:
It is true that This point is not very clear

In EA 12 is as ken.norcross says and in EA 11 is exactly the same

I got a workaround for this working fine and will post a list of steps later on.
[original message]

Vega@localhost Modesto Vega

unread,
May 5, 2015, 4:05:22 AM5/5/15
to sparx-enterprise-archite...@googlegroups.com
The workaround is as follows and does exactly what I was after:

1) Create a package at the same level of the package containing the diagram and entities in the diagram to be copied. This is the most important step otherwise the workaround does not work.

This means that if you have a structure like:
->Root
---->Package A
------->Diagram A
------->Entity A
-------.Entity B
------->Entity C
A package, let's call it Temp, needs to be created as follows:
->Root
---->Package A
------->Diagram A
------->Entity A
-------.Entity B
------->Entity C
---->Temp

2) Copy the diagram
3) Paste the diagram into Temp, this will paste all element in the diagram as links
4) Open the diagram copied into Temp
5) Select and Element, right click on it and choose Advanced\Convert Linked Element to Local Copy
This action creates a copy of the selected Element and most importantly all its relationships.
6) Modify the new diagram as required

Notes: The workaround requires a package otherwise it does not work.
Advanced\Convert Linked Element to Local Copy appears only if the folder where the diagram will be copied is at the same level as the folder contained the linked elements. If it is above and below it does not show. I presume this has something to do with scope.

Thanks to everybody who has provided all the pieces needed to fit this puzzle together.

[original message]

qwerty

unread,
May 5, 2015, 5:16:14 AM5/5/15
to sparx-enterprise-archite...@googlegroups.com
OT: another thread in the line of "where is my menu". Sparx is building the tower of Babylon here!

q.

[original message]
Reply all
Reply to author
Forward
0 new messages