Author Topic: Bring move all diagram elements to the same package  (Read 1083 times)

martindt

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Bring move all diagram elements to the same package
« on: June 16, 2025, 04:07:25 pm »
Hello everyone,
We're structuring the (large) repository of my company. There are elements that were created in different places of the Project Browser. Today, we're re-using some elements in diagrams and we would like to move the elements to the same package.
Today, what I'm doing is :
- Select element in my diagram -> Find in Project Browser -> Drag and Drop to my package.
Is there an easy way to do it for all elements of my diagram ?

Thanks a lot ! That would really ease my life  8)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Bring move all diagram elements to the same package
« Reply #1 on: June 16, 2025, 04:10:58 pm »
Write a little script that moves the elements based on the rules you set.

Should only be a few hours of work for an experienced script writer to write and test such a script.

Geert

shimon

  • EA User
  • **
  • Posts: 162
  • Karma: +5/-0
    • View Profile
Re: Bring move all diagram elements to the same package
« Reply #2 on: June 17, 2025, 09:56:15 pm »
Hi,
I would try AI to write such a script for you.
Shimon

shimon

  • EA User
  • **
  • Posts: 162
  • Karma: +5/-0
    • View Profile
Re: Bring move all diagram elements to the same package
« Reply #3 on: June 17, 2025, 10:42:55 pm »
Hi,
I asked Co-Pilot to write me a script and he got it (almost) right on the first try.
I wrote the Error I got, and he gave me a fix.
In all of 20 minutes, I got the script that you want. It took another five minutes to add it to my Model Addin.

I'm going to open a new thread in the neighboring forum.
Shimon

martindt

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Bring move all diagram elements to the same package
« Reply #4 on: June 18, 2025, 04:41:48 pm »
Hello,
Thank you all for the answers. I'll contact the Admin of my company so that a script could be generated (from AI could be a good idea!)

shimon

  • EA User
  • **
  • Posts: 162
  • Karma: +5/-0
    • View Profile
Re: Bring move all diagram elements to the same package
« Reply #5 on: June 18, 2025, 09:45:28 pm »
Hi,
You don't really need the admin. With the Model-Addin, you can run scripts within EA, as long as you have the permissions in Enterprise Architect.
Sincerely,
Shimon
P.S. The script exists already. It can be found here:
https://sparxsystems.com/forums/smf/index.php/topic,49050.0.html

shimon

  • EA User
  • **
  • Posts: 162
  • Karma: +5/-0
    • View Profile
Re: Bring move all diagram elements to the same package
« Reply #6 on: June 24, 2025, 04:28:03 pm »
Hi,
I uploaded the script as part of a Model-Addin, to Github.
If you have any comments, please post them on the Addin Forum.
Sincerely,
Shimon