Author Topic: Create an Exact Copy of an existing Element  (Read 4874 times)

Ceronimo

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Create an Exact Copy of an existing Element
« on: April 19, 2016, 07:51:42 pm »

Hi

existingElement = aPackage.Elements.AddNew(existingElement.Name, existingElement.Type);

In this case I am addin a new Element with Name and type of an existing element.

But i wann to create a new element with exact the same properties , requierements, Attribute, methods etc.

is there anyway without writing a lot of routines for copying everything ?


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13251
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Create an Exact Copy of an existing Element
« Reply #1 on: April 19, 2016, 09:51:42 pm »
Move element to an (empty) package and use package.Clone()

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Create an Exact Copy of an existing Element
« Reply #2 on: April 19, 2016, 11:52:59 pm »
Rather than (empty) it should be (temporarily created empty).

q.