jkgroman

PISDK.PointList.Merge with empty pointlists

Discussion created by jkgroman on Jun 10, 2013
Latest reply on Jun 18, 2013 by jkgroman

We have been working on a method to create tags in chunks instead of one list IPIPoint2.AddTags method call.  We still use the IPIPoint2.AddTags but with fewer tags.

 

The issue that we are running into is in holding onto the list of created tags that gets returned by the call.

 

Our initial thought is to use a PointList and merge the list.

 

 

 
PointList AllCreatedTagList = new PointList();
PIErrors AllAddErrors = new PIErrors();
IPISDK oPISDK = new PISDK.PISDK();
Server currentPIServer = oPISDK.Servers.DefaultServer;
List<NamedValues> ChunkList = GetChunks(....);

foreach (NamedValues chunkItem in ChunkList)
{
    PIErrors CurrentAddErrors = new PIErrors();
    PointList CurrentCreatedTagList = new PointList();
    IPIPoints2 ServerPointList = (IPIPoints2)currentPIServer.PIPoints;
    ServerPointList.AddTags(chunkItem, out CurrentAddErrors, out CurrentCreatedTagList);
     
    // Merge Lists
    AllCreatedTagList.Merge(CurrentCreatedTagList);
}

but the program crashes without an exception or other error being through at the Merge call.

 

Does the main list (AllCreatedTagList) need some other initial value other than what new gives it?

 

Thoughts and suggestions would be most welcome!

Outcomes