Edge of Floor to Nearest Grid Line

I am working on trying to automate my dimensions from floor edges to the nearest grid line. I have extracted the X & the Y points, but I am still getting errors. I am able to do the grids, and I thought if I just incorporated the floor edge points that it would work. I am at a loss at this moment. Could anyone provide any assistance?FLOOR DIMENSION TEST-1.dyn (54.8 KB)