DIAdem Help

Method: CreateElementList for Data

  • Updated2024-09-12
  • 1 minute(s) read

Method: CreateElementList for Data

Generates in the script interface for internal data a collection of elements. Every element from the generated collection is an Element and thus can be a root type (eDataRoot), a channel group type (eDataChannelgroup), or a channel type (eDataChannel).

Set oElementList = Object.CreateElementList()
ObjectData
Object with this method
oElementListElementList <Data>
Returned object

The following example adds all channel groups and channels of the Data Portal into a list of elements and returns the number of elements contained in this list:

VBScriptPython

 

Dim oMyElementList, oMyChannelgroups, Channelgroup, oMyChannels, Channel
Set oMyElementList = Data.CreateElementList
Set oMyChannelgroups = Data.Root.ChannelGroups
For Each Channelgroup in oMyChannelgroups
  Call oMyElementList.Add(Channelgroup)
  Set oMyChannels = Channelgroup.Channels
  For Each Channel in oMyChannels
    Call oMyElementList.Add(Channel)
  Next
Next
Call MsgBoxDisp(oMyElementList.Count)

Log in to get a better experience