Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: martindt on June 16, 2025, 04:07:25 pm

Title: Bring move all diagram elements to the same package
Post by: martindt 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)
Title: Re: Bring move all diagram elements to the same package
Post by: Geert Bellekens 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
Title: Re: Bring move all diagram elements to the same package
Post by: shimon on June 17, 2025, 09:56:15 pm
Hi,
I would try AI to write such a script for you.
Shimon
Title: Re: Bring move all diagram elements to the same package
Post by: shimon 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
Title: Re: Bring move all diagram elements to the same package
Post by: martindt 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!)
Title: Re: Bring move all diagram elements to the same package
Post by: shimon 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 (https://sparxsystems.com/forums/smf/index.php/topic,49050.0.html)
Title: Re: Bring move all diagram elements to the same package
Post by: shimon 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