Create automatic dimensions from floor edge to nearest grid

I want to create automatic dimensions from the edge of the floor to nearest grids
Genius Loci packages helped me to find a reference of grid element and reference edge of floor
I try to make that scripts but i have some issues

Anyone have a suggestion for me ?

Hi @Alban_de_Chasteigner

I need to your suggestion

What have you tried? Post your work so people can help. As currently formatted you are effectively texting a mechanic and saying: “My car is making noises like “brjrrrbbbbbbrjrrrbbb”, please fix it.”

No mechanic can help you with that info, nor can the community help you with what you have given. Post your DYN, your RVT, and screenshots showing where the issue you are having is.