Book a Demo

Author Topic: Copy & Paste elements including formatting?  (Read 6258 times)

Asperamanca

  • EA User
  • **
  • Posts: 91
  • Karma: +0/-0
    • View Profile
Copy & Paste elements including formatting?
« on: June 01, 2011, 05:39:17 pm »
How do I copy and paste several classes from one diagram to another, so that the layout, size and relative position of those elements towards each other is maintained?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #1 on: June 01, 2011, 08:38:30 pm »
Probably there are better ways to do that now, but my old-fashioned way is: move the diagram to a dummy package, export it to XMI and import it using the Strip GUIDs option. That will make a perfect copy. Finally move the diagram(s) back and remove the dummy package.

q.

Asperamanca

  • EA User
  • **
  • Posts: 91
  • Karma: +0/-0
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #2 on: June 01, 2011, 09:22:44 pm »
That sounds like a bit of a hack  ;)

Also, I want to paste to an existing diagram, whereas your suggestion would create a new diagram.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #3 on: June 02, 2011, 12:48:31 am »
You could drag the existing diagram to where you want as diagram frame. That will show the contents of the old one in the new. But you can't make more connections.

Finally there's the option to do it via automation.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #4 on: June 02, 2011, 10:05:38 am »
How about:
Select the elements on the diagram.
Press Ctrl+C.
Right click on target diagram and select Paste as New. (Or press Ctrl+Shift+V)

Asperamanca

  • EA User
  • **
  • Posts: 91
  • Karma: +0/-0
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #5 on: June 06, 2011, 04:45:12 pm »
I do not want to "paste as new", I want to paste as link.

And the paste itself does work - it just does not copy the way the elements were laid out on the source diagram. After the paste, I have to manually re-arrange everything to get it the way it was in the source diagram.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #6 on: June 07, 2011, 08:24:28 am »
Sorry, my misunderstanding based on the previous advice you had received.

The normal behavior is to preserve the layout of multiple copied elements. Have you tried doing the paste from the Edit menu instead. Since that doesn't have a point to work with it should put them at the same position on your diagram as the originals (not offset to the current mouse point.)

Asperamanca

  • EA User
  • **
  • Posts: 91
  • Karma: +0/-0
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #7 on: June 07, 2011, 04:39:01 pm »
Interesting. Now everything works just the way I expect it to, whether I use Ctrl-v or Paste as link.

I am sure I had this problem multiple times, every time with elements that were referenced in multiple diagrams (even before pasting them to a new one), but just now, I cannot reproduce it.

Thanks for the suggestions. Should it occur again, I will try them!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #8 on: June 07, 2011, 05:14:48 pm »
I think it happens when you copy from a diagram which has unsaved changes.

Asperamanca

  • EA User
  • **
  • Posts: 91
  • Karma: +0/-0
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #9 on: June 07, 2011, 05:26:15 pm »
Quote
I think it happens when you copy from a diagram which has unsaved changes.

You might be onto something there.
Thanks! I'll keep an eye on that!

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #10 on: November 29, 2011, 06:43:30 am »
Sparx have just confirmed a bug I reported where copy and paste of a diagram looses formatting. (11091296)

Our developers have confirmed that there is a bug in this behaviour and it is logged to be fixed.  We cannot yet say when (in which build) the fix will be implemented.  

As a current workaround we recommend copying the elements from one diagram to another (creating an empty diagram to paste the elements
onto) rather than copying the diagram itself.  See the "Copy And Paste Diagram Element" help topic for details.
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Copy & Paste elements including formatting?
« Reply #11 on: November 29, 2011, 06:52:37 am »
You could copy the diagram and delete the unwanted elements from it.
Happy to help
:)