Book a Demo

Author Topic: Copy an element from one package to an other  (Read 3932 times)

VaGen

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Copy an element from one package to an other
« on: November 23, 2010, 02:21:57 am »
Hello forum,

From an addin, I'd like to copy an element (class, actor, ...) from 1 package to an other package.
I really want to "clone" / "duplicate" the source element (with all operations, attributes, ...).
I don't wan't any links between the src & dst elements.

I did not find any way in EA help to perform such an operation and a look in the forum did not help,

Thanks in advance for any tips ;)

Ondrej Kolenaty

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Re: Copy an element from one package to an other
« Reply #1 on: November 23, 2010, 08:00:21 am »
Hello, I guess that Your only option is to create a new element and copy value of each read/write property, which You find in reference part of help. Also You should not ommit attributes, scenarios, tagged values etc.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Copy an element from one package to an other
« Reply #2 on: November 23, 2010, 08:51:24 am »
On a diagram.
Copy (Ctrl+C)
On a diagram in the target package.
Paste as New (Ctrl+Shift+V)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Copy an element from one package to an other
« Reply #3 on: November 23, 2010, 05:43:00 pm »
Simon, since this is the "Automation Interface, Add-Ins and Tools" forum I guess VaGen was looking for a way to do this using the API.

I think Ondrej is right, you'll need to create a new element and copy everything you need to the new element.
The only other option I can think of is to
- create a new package,
- move the element into that new package,
- export the package to XMI
- Import the package from XMI with option "strip GUIDs"
- move the source element back from where it came
- move the target element to a suitable location
- delete the temporary packages.

But I think I would go for the first option.

Geert