Working with the Elements Collection, the ElementList Collection, and the Element Object
- Updated2024-09-12
- 4 minute(s) read
General > Basic Information > Working with the Elements Collection, the ElementList Collection, and the Element Object
Working with the Elements Collection, the ElementList Collection, and the Element Object
You can use the ElementList collection and the Element object in several object-oriented script interfaces. The Element object always contains the properties Name and Properties and the method IsKindOf, regardless of the interface. The ElementList collection and the Elements collection always have the Item method and the Count property. The ElementList collection of the Data API and the Elements collection also have the Add method, the Removemethod, and the RemoveAll method.
The following section contains an overview of the use of the ElementList collection and the Element object in the various object-oriented interfaces:
Interface | Data (Internal data) | DataFinder (NAVIGATOR) | Data stores (NAVIGATOR) | DataPlugins |
Use | Access to the Elements in the Data Portal. | Access to the Elements of the Search Results List or of the File Browser of a local DataFinder or of a DataFinder instance. Access can occur with and without using the Navigator interface. | Access to the Elements in the Search Results List of a data store or in the Data Browser. Access can occur with and without using the Navigator interface. | Import of different file formats, with a script. |
Possible Access |
Data.Portal.List.Selection... Data.Root... |
Navigator.Display.CurrDataFinder. Browser... Navigator.Display.CurrDataFinder. ResultsList... |
Browser... Navigator.Display.CurrDataStore. ResultsList... |
... ... |
Object Overviews | Objects Overview | Objects Overview | Objects Overview | Objects Overview |
Access | Read and write access | Readonly | Read and write access | Read and write access |
Possible Types | Root, channel group, channel (TDM data model) | File, channel group, channel (TDM data model) | Depending on data model. The ASAM base model contains, for example, the elements MyTest, MySubtest, MyMeasurement, MyMeaQuantity, MySubmatrix, MyLocalColumn, MyUnit, MyUser, and MyUnitUnderTest. | Root, channel group, channel (TDM data model) |
Transition to the Internal Data | Data already internally available | Loading the elements with the method Navigator.LoadData into the Data Portal. | Loading the elements with the method Navigator.LoadData into the Data Portal. | Loading the elements with DataFileLoad() including the DataPlugin specifications. |
Elements collections |
Data.Root.Channelgroups(i).Channels |
None |
...Reference.Elements |
Root.Channelgroups(i).Channels |
ElementList collections | Return values of the loading functions: Data.CreateElementList |
Browser.SelectedElements Navigator.Display.CurrDataFinder. ResultsList.Selection ResultsList.Elements oMyDataFinder.Results ...Channelgroups ...Channels |
Browser.SelectedElements Navigator.Display.CurrDataStore. ResultsList.Selection ResultsList.Elements oMyStore.GetElementList() |
None |
Additional Notes
- Elements of the internal data: Use the methods Add and Remove from the collections Channelgroups and Channels to create new channel groups and channels and to delete existing elements. Use the property Properties of the Element object to determine the properties of the root, of a channel group, or of a channel and to assign values to these properties. You also can use the property Properties to create new custom properties.
- Elements of a DataFinder: DataFinders Use the property Properties of the Element object to determine the properties of a file, of a channel group, or of a channel. You cannot create new custom properties or change the values of properties with a script. You cannot create new elements with the ElementList collection.
- Elements of a DataFinder: If you want to create channel groups or channels or if you want to edit properties, you must load the data into the Data Portal and edit the data with the <Data> element object in the Data Portal and then save the data.
- Elements of a data store: Use the methods Add and Remove from the collections RootElements, Children, and Reference.Elements, for example, to create new SubTests, Measurements, or UnitUnderTests or to delete existing elements. You can use the methods AddReference and RemoveReference to join elements and to undo concatenations. Use the property Properties of the Element object, for example, to determine different properties of a test, of a measurement quantity, or of a user and to create new instance properties.
- Elements of a data store: Use a Loading configuration to specify how DIAdem imports the properties of different elements and levels into DIAdem.
- In the Data Interface, the ElementList collection is a list of elements in the Data Portal. Use the ElementList collection to access channels, channel groups, or the root. You can add elements to the collection or remove elements from the collection. The data in the Data Portal remains unchanged. Every element of the collection ElementList is an Element.