Book a Demo

Author Topic: How to copy an element?  (Read 4019 times)

SimonSwisscom

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
How to copy an element?
« on: February 03, 2011, 09:19:15 pm »
Hi Automation Forum,

We are having difficulties setting stereotypes to new elements created via scripting. The stereotypes stem from a special profile and have special "looks". When setting such a stereotype, it is "kindof correctly set" but the "looks" of the new element still is not the one from the profile.

Now, we think that we could try to copy an already existing element that has the correct "looks" and stereotype then set its name, etc. instead of creating a new one from scratch.

But: How to copy an element?

Thanks for help in advance!   --Simon--

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to copy an element?
« Reply #1 on: February 03, 2011, 10:55:49 pm »
Simon,

I'm afraid that approach won't work, as copying an element is not a build-in function of the API.
So the only think you can do is create a new element, and copy all the properties of the original element to the new element, one-by-one :'(

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to copy an element?
« Reply #2 on: February 03, 2011, 11:24:50 pm »
a)
Move to temp package
Export as XMI
Import using Strip GUIDs

b)
write a transformation

q.
« Last Edit: February 03, 2011, 11:25:26 pm by qwerty »