From: Ahmet Bakan (
Date: Thu May 06 2004 - 17:45:21 CDT

Hi Jerry,

You can save below procedure into a file (i.e. a2adist.tcl) and call it vmd
tkon shell.

To make it work type in vmd tkon shell:

set atomA [atomselect top "index 555"]
set atomB [atomselect top "index 666"]
source a2adist.tcl
a2adist atomA atomB

You can also make extra calculation within for loop.

proc a2adist {A B} {
        set nf [molinfo top get numframes]
        set outfile [open adist.txt w]
        puts $outfile "Frame# A2A_Distance"
        for {set i 0} {$i < $nf } { incr i } {
                set posA [$A get {x y z}]
                set posB [$B get {x y z}]
                set dist [vecdist $posA $posB]
                puts $outfile "$i $dist"
        close $outfile

Ahmet Bakan
Chemistry, Junior
Koc University
ICQ #86167698

-----Original Message-----
From: [] On Behalf Of
Jerry Ebalunode
Sent: Thursday, May 06, 2004 11:18 PM
Subject: vmd-l: measuring distances in vmd tkon

Hi all,
Which commands or set of commands could one use in measuring distances
between two atoms and if possible monitoring this property over a
and writing it to disk for later examination, within the vmd tkon shell.
Thanks for any help in advance.

Jerry Ebalunode
Graduate Research Assistant
RM 402F Houston Science Center
Phone: 713-743-8367
Dept. of Biology and Biochemistry
University of Houston.
4800 Calhoun Road
Houston, TX 77204