From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Thu May 24 2012 - 09:13:04 CDT

On Thu, May 24, 2012 at 9:16 AM, <peter.schmidtke_at_fr.netgrs.com> wrote:
> Dear VMD users/developers,
>
>
>
> Id like to create a selection of atoms that is within a given distance from
> a point in 3D cartesian space (not a molecular object, atom or whatsoever).
>
>
>
> How can this be achieved in VMD/tcl? Ive been searching around for
> documentation but was fairly unsuccessful.
>
> Basically Id like to do something like :
>
> atomselect top protein within 20.0 of {-1 1 0}
>
>
>
> Where {-1 1 0} is the cartesian coordinate from which Id like to do the
> measure.

nope. you can't do this. "within X of Y" requires
Y to be a selection of atoms. please see the
documentation. computer software is brutally literal.
it doesn't know how to do "the reasonable thing(tm)".

what you *can* do is math with the coordinates.
for example you can try this (untested):

atomselect top "protein and ( ((x+1.0)*(x+1.0)+(y-1.0)*(y-1.0) + z*z) < 400.0)"

cheers,
    axel.

>
>
>
> Thanks in advance for your help.
>
>
>
> Best regards.
>
>
>
> Peter Schmidtke

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com http://goo.gl/1wk0
College of Science and Technology
Temple University, Philadelphia PA, USA.