DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Large ElementList.AddElementList Issue

Solved!
Go to solution

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

0 Kudos
Message 1 of 4
(1,936 Views)
Solution
Accepted by topic author JoshRew

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

0 Kudos
Message 2 of 4
(1,893 Views)

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

0 Kudos
Message 3 of 4
(1,879 Views)

Confirming that DIAdem 2021 appears to fix the issue.

 

Thanks Walter (and Devs)!

 

-Josh

0 Kudos
Message 4 of 4
(1,707 Views)