I am not sure if there is any reason in particuar, for which you want to use tcl (maybe running MD simulations with NAMD?). However, you can have a look into the tcl forces routine that serves the purpose: http://www.ks.uiuc.edu/Training/Tutorials/science/forces/forces-tutorial-html/forces-tutorial.html
On the other hand, if you don't necessarily need to use Tcl scripting, you can always think of adopting GROMACS for your simulations and in that case use the pull code, which is a no-brainer. Documentation here: http://manual.gromacs.org/documentation/2016-beta2/user-guide/mdp-options.html?highlight=pull#mdp-pull