09-25-2017 09:00 AM
Hello,
I am trying to list all my groups in my data using GetChannelgroups() but it is only getting the last group. To show this, I opened a new DIAdem file with the example groups - EXAMPLE, Noise data, Results_Noise data, Room temperatures. It might be important to note that in the Data Portal, Room temperatures is bold. In the Script, I'm doing the following:
Dim oMyChannelGroups, oMyChnGrp Set oMyChannelGroups = Data.GetChannelGroups("[]") For Each oMyChnGrp in oMyChannelGroups Call MsgBoxDisp(oMyChnGrp.Name) Next
which only prints "Room temperatures". Is there a way to get all the group names?
09-25-2017 09:20 AM
I figured it out! I misunderstood the explanation of the function. I needed to do `Data.GetChannelGroups("*")'.
09-25-2017 09:24 AM
Your script is correct, simply replace the square brackets with a wildcard '*'.
Set oMyChannelGroups = Data.GetChannelGroups("*")
Empty square brackets returns only the default group.
09-26-2017 01:53 PM
To get all just use
data.Root.ChannelGroups