Author Topic: Copy Elements Between Diagrams  (Read 9155 times)

Charly78

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Copy Elements Between Diagrams
« on: April 15, 2015, 07:32:38 pm »
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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #1 on: April 15, 2015, 07:57:29 pm »
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.
« Last Edit: April 15, 2015, 07:57:42 pm by qwerty »

Charly78

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #2 on: April 15, 2015, 09:23:46 pm »
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.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1145
  • Karma: +30/-8
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #3 on: April 15, 2015, 09:39:20 pm »
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.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #4 on: April 15, 2015, 10:02:14 pm »
Quote
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.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1145
  • Karma: +30/-8
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #5 on: April 17, 2015, 10:41:53 pm »
Quote
Quote
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.
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?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #6 on: April 18, 2015, 06:09:47 am »
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.

VKN

  • EA User
  • **
  • Posts: 187
  • Karma: +9/-1
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #7 on: April 20, 2015, 09:53:47 am »
Quote
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

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1145
  • Karma: +30/-8
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #8 on: April 20, 2015, 09:44:50 pm »
Quote
Quote
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
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.

VKN

  • EA User
  • **
  • Posts: 187
  • Karma: +9/-1
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #9 on: April 21, 2015, 09:44:19 am »
Quote
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.

Charly78

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #10 on: April 30, 2015, 09:15:26 pm »
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

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1145
  • Karma: +30/-8
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #11 on: April 30, 2015, 10:24:12 pm »
Quote
  • 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".
« Last Edit: April 30, 2015, 10:24:53 pm by modesto.vega »

ken.norcross

  • EA User
  • **
  • Posts: 63
  • Karma: +0/-0
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #12 on: April 30, 2015, 11:56:00 pm »
in V12 it is a sub-menu below the "Advanced" menu on the right click pop up menu

right click=>advanced=>convert...

Charly78

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #13 on: May 01, 2015, 12:41:39 am »
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

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1145
  • Karma: +30/-8
    • View Profile
Re: Copy Elements Between Diagrams
« Reply #14 on: May 01, 2015, 01:20:08 am »
Quote
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.