my problem is the check of hole coordinates. I have a List<Hole> HoleList = new List<Hole>;
This list has over 5000 listings with the under points (StartX-coordinate, StartY-coordinate, StartZ-coordinate, EndX-coordinate etc.). Now I start to search holes with the same Y-, X- & Z-coordinate but not the same name -> Part. But in the list can be up to 4 holes with the same coordinate. My question ist how can i mark or assign all holes with the same coordiantes so that i can find all pairs later in the list?
Here is my code:
void StartAuswertung()
{
foreach (Hole B in HoleList)
{
foreach(Hole A in HoleList)
{
if (B.Equals(A))
{
continue;
}
if ((B.StartX == A.EndeX &&
B.StartY == A.EndeY &&
B.StartZ == A.EndeZ) &&
B.Part != A.Part)
{
A.Pair_ST_EN.Add(B);
B.Pair_ST_EN.Add(A);
}
}
}
}
And this is my class:
public class Hole
{
public string Name;
public string Part;
public double StartX;
public double StartY;
public double StartZ;
public double EndeX;
public double EndeY;
public double EndeZ;
public List<Hole> Pair_ST_EN = new List<Hole>();
}
Do you understand my problem?
Thanks for help!