Section 5. Sort elements from a Package or an Element by Name
This help article explains how to use eaUtils Sort By Name feature on the elements contained in a package or element.
This feature runs on a package or an element selected from the Project Browser (it can also be run on a package tree, click here for more information).
Enterprise Architect already sorts elements by their name, however this feature has been implemented so that elements can be sorted by taking into account integer values within a string value. Hence this feature only makes sense when the option "Identify and sort integers within string values" is set (default setting).
To illustrate the purpose, the following list is sorted by EA when running Contents > Reset Sort Order:
- Class03, Class1, Class10, Class15, Class2, Class3, Class32, Clatss35, Class39, Class5, Class9.
eaUtils Sort By Name will update the list with the following order:
- Class1, Class2, Class03, Class3, Class5, Class9, Class10, Class15, Class32, Class35, Class39.
The following diagram shows the elements defined in a package with various names to illustrate the use of eaUtils Sort By Name feature.
Sort elements within a package by name
Important : eaUtils default settings must not be changed. If the option "Identify and sort integers within string values" is disabled, the result will be the same as EA default sorting order.
Right click in the Project Browser on the package where elements need to be sorted > Extensions > eaUtils > [Browser] Sort elements.
In the following dialog window, select Name as the sorting option and confirm that you would like to proceed.
Note: eaUtils sort by settings are displayed. The settings can be opened and modified if needed.
Once completed, the following window is displayed:
The expected result is illustrated below.
The new sorting order is visible in Enterprise Architect project browser as illustrated below: