From: Thomas C. Bishop (
Date: Fri Jan 23 2015 - 13:04:10 CST

Dear VMD,
I"m looking for a quick way to generate a list of atom pairs that are within a specified distance of each other.
e.g find oxygen atoms that are within say 3A of each other.

I thought I could use the within command
set sel [atomselect top "within 3 of name O" ]

This selects all atoms within the specified distance (in Å) from a selection,

So the above sel includes ALL atoms named O b/c each oxygen is within 3 of itself :-)

Maybe it's just Friday but I dont' see a simple solution here.
This selection is being used to highlight various pairs associated with a radial distribution analysis.

Any tips,tricks or solutions greatly appreciated.
Is it worthwhile to suggest a " -self" option be added to the within command

Thanks in advance,

   Thomas C. Bishop
    Tel: 318-257-5209
    Fax: 318-257-3823