Hey everyone... Forgive me if this ends up getting more complicated than it should. I haven't had a real need for anything like this before and a bit lost. I am trying to figure out how I would go about doing a few things. So...
Dim _List As New List(Of Tuple(Of Double, String, String, Double, Integer))
For Each _ObjID In _Objects
Dim _CurrentObject As Object= _Trans.GetObject(_ObjID, OpenMode.ForRead)
_ObjProperties = New Tuple(Of Double, String, String, Double, Integer)(_CurrentObject.Prop1, _CurrentObject.Prop2, _CurrentObject.Prop3, _CurrentObject.Prop4, _CurrentObject.Prop5)
_List.Add(_ObjProperties)
Next
Simple, no issues... For example, if I returned each item in _List, I would end up with something like this:
(1.00, "A", "B", 100.00, 1)
(2.00, "A", "B", 100.00, 1)
(1.00, "A", "B", 100.00, 1)
(9.00, "C", "A", 100.00, 1)
(1.00, "C", "A", 100.00, 1)
(2.00, "A", "B", 100.00, 1)
(1.00, "A", "B", 100.00, 1)
(9.00, "C", "A", 100.00, 1)
What I need to do now though is the part I am lost with... I want to take my _List and combine items that match certain criteria...
For example, I want to combine all items that have the same values for _CurrentObject.Prop1, _CurrentObject.Prop2, _CurrentObject.Prop3, but I want to do something like add/subtract the values for _CurrentObject.Prop4, _CurrentObject.Prop5... Not sure if that sounds right, but... This would be what the List looks like in the end...
(1.00, "A", "B", 300.00, 3)
(2.00, "A", "B", 200.00, 2)
(9.00, "C", "A", 200.00, 2)
(1.00, "C", "A", 100.00, 1)
Does this make sense? If so, anyone have any example of how I could go about something like this? I am thinking that a For Each and If statement combo might be the right route, but I am drawing a complete blank right now...