Thank you for the clarification. The key to this script is the understanding of the function
dt << get rows where()
And then looping through all of the rows that have valid Before X and Y values.
Names Default To Here( 1 );
dt = Current Data Table();
xFudge = Abs( Min( Col Min( :"x-before"n ), Col Min( :"x-after"n ) ) );
yFudge = Abs( Min( Col Min( :"y-before"n ), Col Min( :"y-after"n ) ) );
dt << New Column( "Repeat_New", character, set each value( "New" ) );
For( i = 1, i <= N Rows( dt ), i++,
If( Is Missing( :"x-before"n[i] + :"y-before"n[i] ) == 0,
Try(
:Repeat_New[dt << get rows where(
Sqrt(
((xFudge + :"x-before"n[i]) - (xFudge + :"x-after"n)) ^ 2 + ((yFudge
+:"y-before"n[i]) - (yFudge + :"y-after"n)) ^ 2
) < 100 & Row() >= i
)] = "Repeat"
)
)
);
Given your estimate of how many rows your data table may have, you can expect the script to take a significant amount of time to process.
My use of <= 100 units as the distance considered to be the same defect, is just my guess. I have no real way to set that value, given that I do not know the resolution of the defect measurement tool and your stepper resolution capability. But, you should be able to estimate the tool variability and from that setting the distance units.
Jim