Floor & Grid Intersection

I am trying to find a way to put together a script that will tell me if a grid line intersects with the floor, and if so I would like to place a dimension. I am able to dimension the floor with some pieces of code I have found, but now I would like to include the closest grid line. Does anyone out there have any ideas as to how I could accomplish this?
Thank you in advance

probably we can help each other
i am also trying to dimension floors
how did you get the side faces of the floors with youre code?
(or are you placing detail lines )

do you have a screenshot of what you are exactly want to do?