Docking the molecule on the surface

Hi all,

        I am new to MS. Is there any way to measure the distance between the layer and the small molecules while doing MD simulations?  I am kinda of stuck to to know the precise distance. Moreover, when I just copy paste the small molecule to the surface, I don't know how far I am away from the surface. If I run simulation at different distance, the results may vary at each time. Is it possible to always keep the small molecule at certain distance. Any help will be of great help.

Thanks