02-08-2021 12:15 PM
I've run in to an issue in DIAdem 2019 SP1 and DIAdem 2020 SP1 where using ElementList.AddElementList doesn't work correctly when merging a list with more than 32768 items.
When using ListMergeModeAdd to add one Element List of >32768 items to another, the method throws an error and only adds the first 32768 items. ListMergeModeUnion does not throw the error, but also only adds the first 32768 items in the origin collection list. I didn't test the other merge options, but they may have the same limitation.
In this case, I'm specifically adding the channels collection from several channel groups to another collection in order to run some statistics, and ran into this error when one source channel group contained more than 32768 channels.
I wrote a script to generate 2 groups, one with 32768 channels, and one with 32769 channels. It then attempts to Union/Add each ".Channels" collection to the individual Element Lists, which results in an incorrect number of items for the one with 32769 channels. The actual dataset had more channels, but I noticed that the threshold was 32768 so just went 1 further for the demonstration. At the end, I have the script manually "fix" the longer list by individually adding any missing channel(s), demonstrating that the Element list can contain the desired number of channels, so the issue is with the AddElementList command merging too many items at once.
Attached Script Output:
Group1 Channel Count: 32768
Group1 Union Channel Count: 32768
Group1 Add Channel Count: 32768
Group2 Channel Count: 32769
Group1 Union Channel Count: 32768
13008 - The DataElements parameter in the AddElementList method is invalid.
Group1 Add Channel Count: 32768
Group1 Add Fix Channel Count: 32769
Solved! Go to Solution.
02-15-2021 06:02 AM
Hello JoshRew,
Thank you for your information. The bad news is yes, currently we have a limit for the element lists. The good news is, for the next DIAdem version 2021 we will extend this limit to 2^31.
Greetings
Walter
02-15-2021 09:30 AM
Thanks for the quick reply!
I've got a workaround in place, and we'll make sure to upgrade to 2021 when it comes out!
-Josh
05-28-2021 10:48 AM
Confirming that DIAdem 2021 appears to fix the issue.
Thanks Walter (and Devs)!
-Josh