Overview
It The TrackChanges Unused Objects provides a table of solution listing all unused objects in the solution. This view is not dynamics, updated through it is updated when first loading and via the Refresh button.
Its purpose is to identify and list system components or objects that can be considered for removal, thereby enhancing removed to enhance efficiency by eliminating redundant or outdated configurations. The functionality extends to updating the list of unused objects and deleting them. It also includes an additional verification step for indirect usage through reference tags, script expressions, or reflection methods to prevent the accidental deletion of necessary components. This feature is applicable in scenarios focused on system cleanup, optimization, and maintenance, where identifying unused objects is critical for resource management. It does not need any configuration; to use it, navigate to Track Changes → Unused Objects. unnecessary configurations.
On this page:
Table of Contents | ||||
---|---|---|---|---|
|
Removing Unused Objects
managementLimitations, when its not safe to remove
This feature only shows the places the object is using directly, not using by an indirect reference or string manipulation.
Here are some examples where an object is used indirectly:
- Via TagReference using the .Link Property (reason why use the Tag1.GetName() when possible, instead of "Tag1" when setting the value for this property)
- Via AssetPath, using the syntax. Asset("/folder1/tag1")
- Via scripts settings directly TagNames on TrendChart and other objects.
When is generally safe to remove
For most solutions, the indirect reference it's used only for Tags. They display can be used by strings reference using the Client.OpenDiaplay("stirng") method.
Other objects for other modules, like Datasets, Devices, typically are not used as a reference.
Therefore, in general, other objects you can remove directly, and Tags or Displays, as long you aren't used the describe indirect access.
The reason, the "in general" warning was present, is that using the Toolkit, like the TK.GetObjectValue(),
it's possible to indirectly access any object in the application.
Removing Steps
If you want to proceed and remove an object, with the assistance of this table, follow these steps:
- Refresh the UseCount table
- Select one more lines (using shift-click and control-click)
- Press the Remove Selected Lines button.
Unused Objects Table Columns
TrackChanges Unused Objects Table | |
---|---|
Column |
The Unused Objects feature allows users to identify and remove unused objects from their solution. The Refresh button located on the Unused Objects tab displays all the objects that are unused. Users can select the object they want to remove and click Remove. Multiple objects can be removed at once by selecting multiple objects and clicking Remove. It is important to note that this feature will only work if an object is not in use. If an object is being used, either on the screen or by a line of code or script, this feature will not work. Additionally, it is highly recommended to pay attention to tags that are being passed by the .Link property and to use the <Object>.GetName()
method rather than the object name as a typed text in expressions like TK.GetObjectValue
.
Identifying
Access the Track Changes → Unused Objects tab and click the Refresh button to get the current unused object list.
Removing Unused Objects
All the objects found are unused. Select the object you want to remove and click Remove. You can remove more than one object by selecting multiple objects at once and clicking Remove....
When It Works and Doesn't
The Unused Objects feature only works for objects that are not in use. If an object is being used by something on the screen or by a line of code or script, this feature will not work. It is important to note that the functionality does not identify tags being passed as a reference by the .Link property. Therefore, it is highly recommended to use caution when removing objects that are being passed by the .Link property, as this can have unintended consequences. Additionally, the feature does not recognize objects that are used as expressions such as TK.GetObjectValue
. To ensure proper identification, it is recommended to use the <Object>.GetName()
method rather than the object name as a typed text.
Unused Objects Table Columns
Property | Description |
---|---|
ID | Assigns a unique identifier to each object. |
Module | Links the object to a specific module within the solution. |
ObjectName | Names the object for easy identification. |
In this section:
Page Tree | ||||
---|---|---|---|---|
|