DIAdem Help

Method: AddElementList for FreeElementList <DataFinder>

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

Method: AddElementList for FreeElementList <DataFinder>

Connects in the object-oriented script interface in DIAdem NAVIGATOR two element lists of a DataFinder.

Object.AddElementList(DataFinderElementList, [ListMergeMode])
ObjectFreeElementList <DataFinder>
Object with this method
DataFinderElementListFreeElementList <DataFinder>
Specifies a list with data elements.
[ListMergeMode]Variant
Specifies how DIAdem connects the Element lists.
0
ListMergeModeAdd 
Merges the second Element list with the first element list (default). Example:
Element list 1: [5,10,15,20,25]
Element list 2: [10,20,30,40,50]
=> [5,10,15,20,25,10,20,30,40,50]
 1
ListMergeModeUnion 
Creates the union from both Element lists. Elements from the second Element list, which are also in the first Element list, are left out. Example:
Element list 1: [5,10,15,20,25]
Element list 2: [10,20,30,40,50]
=> [5,10,15,20,25,30,40,50]
 2
ListMergeModeIntersection 
Creates the intersection from both Element lists. Elements from the second Element list, which are not in the first Element list, are left out. Example:
Element list 1: [5,10,15,20,25]
Element list 2: [10,20,30,40,50]
=> [10,20]
 3
ListMergeModeDifference 
Creates a new Element list from the elements of the first Element list, which are not in the second Element list. Example:
Element list 1: [5,10,15,20,25]
Element list 2: [10,20,30,40,50]
=> [5,15,25]
 4
ListMergeModeSymetricDifference 
Creates a new Element list from the elements which are only in one of the two Element lists. Example:
Element list 1: [5,10,15,20,25]
Element list 2: [10,20,30,40,50]
=> [5,15,25,30,40,50]

The following example generates two element lists with search results and connects the elements of the second list in two different ways with the first list:

VBScriptPython

 

Dim oMyDataFinder, oMyElementList1, oMyElementList2, oMyQuery1, oMyQuery2, oMyResults
Set oMyDataFinder = Navigator.ConnectDataFinder("My DataFinder")

'First Query
Set oMyQuery1 = oMyDataFinder.CreateQuery(eTextQuery)
oMyQuery1.Text = "TR_M17_QT_32-1"
Call oMyDataFinder.SearchElements(oMyQuery1)
Set oMyResults = oMyDataFinder.ResultsElements
Set oMyElementList1 = oMyDataFinder.CreateElementList
Call oMyElementList1.AddElementList(oMyResults)

'Second Query
Set oMyQuery2 = oMyDataFinder.CreateQuery(eTextQuery)
oMyQuery2.Text = "TR_M17_QT_32-4"
Call oMyDataFinder.SearchElements(oMyQuery2)
Set oMyResults = oMyDataFinder.ResultsElements
Set oMyElementList2 = oMyDataFinder.CreateElementList
Call oMyElementList2.AddElementList(oMyResults)

'Combining via ListMergeModeAdd
Call oMyElementList1.AddElementList(oMyElementList2, ListMergeModeAdd)
Call MsgBoxDisp("Sum of Elements (ListMergeModeAdd): " & oMyElementList1.Count)

'Combining via ListMergeModeIntersection
Call oMyElementList1.AddElementList(oMyElementList2, ListMergeModeIntersection)
Call MsgBoxDisp("Sum of Elements (ListMergeModeIntersection): " & oMyElementList1.Count)