How to Find and Remove Unused Models in Your Project
As your project grows, it is inevitable to have more and more orphans model elements left in your project. Such model elements are not visualized in any diagrams and are not useful anymore. This article will show you how to locate those elements so that you can remove them from your project.
To find out those unused model elements, open the Project Browser by selecting View > Project Browser from the application toolbar first. Then select the Model Structure tab. Right click on the project root node on the left and select Viewless Model Elements… from the popup menu. ‘Viewless Model Elements’ are model elements that have not been visualized on any diagrams in the project.
A list of model elements which do not appear on any diagram will be listed in the Viewless Model Elements window.
In case a large number of viewless model elements are found, you can apply Model Element Type Filter to select the type(s) of model elements to be listed. You can configure the filter by clicking on the … button next to the caption Model Element Type Filter.
By default, the Viewless Model Elements window will list out all the elements that have completely no view in the project. You can configure the list to list model elements that have no master view instead. This refers to model elements that MAY have been visualized on a diagram, but just that the view is an auxiliary view.
It is quite common for container model elements (e.g. Package, Model) to have no view in the project. If you want to skip them in the list, keep Only show model elements without child checked.
Once the configuration is done, check through the list to see if any model elements are really unused in your project. You can delete an unused model element by right clicking on it and selecting Show in Project Browser to locate them in Project Browser tree to take a final look.
You can also turn on the Auto show Project Browser option so that the element will be selected automatically on Project Browser when you select it in the Viewless Model Element dialog.
Finally, you can delete a model element directly from the Project Browser or by pressing the delete button in the Viewless Model Elements window.
Related Know-how |
Related Links |
Leave a Reply
Want to join the discussion?Feel free to contribute!