Book a Demo

Author Topic: how to copy a diagram to another package  (Read 4673 times)

dkkoenig

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
how to copy a diagram to another package
« on: September 23, 2007, 02:09:36 pm »
hallo,

how can i copy a diagram(with elements) to another package in a EAP-file, with Automaton Interface.

???

thanks
« Last Edit: September 23, 2007, 02:09:45 pm by dkkoenig »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: how to copy a diagram to another package
« Reply #1 on: September 24, 2007, 05:54:31 am »
I believe you'll have to do this the hard way.

Create the target diagram. Then iterate through the source diagram, first creating a copy of each diagram element. As you do this you'll likely want to point each of the new ones to the same ElementID as the source diagram object (unless you want to create new elements, in which case you should do that at this point). You can set the target diagram object's size and position at this point.

Now iterate though the source Diagram Links, following the same pattern as above.

Voila!

Not instant by any means, but it works and is less effort than it seems.

David
No, you can't have it!

dkkoenig

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: how to copy a diagram to another package
« Reply #2 on: September 25, 2007, 03:03:16 pm »
OK, thanks  ;D

peter.zrnko

  • EA User
  • **
  • Posts: 253
  • Karma: +0/-0
    • View Profile
Re: how to copy a diagram to another package
« Reply #3 on: September 25, 2007, 10:04:22 pm »
Rightclick a diagram in Project browser and select Copy Diagram to Clipboard.
Rightclick the target package in Project browser and select Paste Diagram.

See help Copy a Diagram.
Peter

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: how to copy a diagram to another package
« Reply #4 on: September 26, 2007, 02:00:57 am »
Thanks Peter,

That works perfectly of course, and is always worth mentioning when the subject of copying diagrams comes up.

However, in this case the problem is how to achieve this through the API, which forces us to go through the process in a bit more detail.

David
No, you can't have it!

thomaskilian

  • Guest
Re: how to copy a diagram to another package
« Reply #5 on: October 01, 2007, 02:00:46 am »
Embedded elements are even worse as their parents need to be on the diagram first...