Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Ceronimo on April 19, 2016, 07:51:42 pm

Title: Create an Exact Copy of an existing Element
Post by: Ceronimo 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 ?

Title: Re: Create an Exact Copy of an existing Element
Post by: Geert Bellekens on April 19, 2016, 09:51:42 pm
Move element to an (empty) package and use package.Clone()

Geert
Title: Re: Create an Exact Copy of an existing Element
Post by: qwerty on April 19, 2016, 11:52:59 pm
Rather than (empty) it should be (temporarily created empty).

q.