Book a Demo

Author Topic: Programmatically copying/pasting  (Read 3074 times)

larrynator

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Programmatically copying/pasting
« on: February 05, 2013, 12:57:09 am »
This should be simple, but I can't seem to find the answer anywhere.  I want to programmatically perform the same thing that would happen if a user selected a package, copied it, pasted it, and then changed the name of the resulting package.  Looking through the object model I'm not seeing anything related to copy/paste.  Can someone point me in the right direction?

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Programmatically copying/pasting
« Reply #1 on: February 05, 2013, 01:21:49 am »
AFAIK the only way is to create a new EA object, copy all the properties from the source object and update the newly created element. Need to be done recursively for any further contained EA objects from your source object.

HTH
Günther

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Programmatically copying/pasting
« Reply #2 on: February 05, 2013, 02:11:23 am »
Have a look at the Package.Clone method.

q.