From: Bjørnar Jensen (bje076_at_ift.uib.no)
Date: Tue Feb 12 2013 - 09:59:56 CST

Hi,

you can easily add selections (for display) from the TCL console.
The user guide has info on this:
http://www.ks.uiuc.edu/Research/vmd/current/ug/node138.html

In general, you'll want to do something like this:

mol selection "water and sqrt((x-$a1)^2+(y-$b1)^2+(z-$c1)^2)<=6"

You might want to check out the "mol modselect" command too ...

Best regards,
Bjørnar Jensen.

On 2013-02-12 15:59, Raul Araya wrote:
> Dear VMD users.
>
> I have a dynamic selection I will like to display on the Open-GL
> window in order to check if my selecction is working right. The
> problem is that this selection will depend on tha coordinates of the
> center of other selection and must be updated every frame, but since
> one slection depends on the variables set for ahother the selection
> canot be made from the Graphics Representations menu. How can I
> display my desired selection from the Tcl/Tk console?
>
> Here is the selection...
>
> set P1 [atomselect top "protein and resid 147 32 80 199 22 209 140 87
> 88 136 139 213 29 202 205 206 143 140 144 85 84 25 26 11 12 15 17 92
> 91 133 and segname PROA and name CA"]
>
> set C1 [ measure center $P1]
> set a1 [lindex $C1 0]
> set b1 [lindex $C1 1]
> set c1 [lindex $C1 2]
>
> set wat1 [atomselect top "water and
> sqrt((x-$a1)^2+(y-$b1)^2+(z-$c1)^2)<=6"]
>
> The idea is to select the water molecules that are inside of a 6
> angstrom sphere centered in the geometrical center of the residues
> selected as P1.
>
> Thanks.
>
> Raúl Araya Secchi
> B.Sc Molecular Biotechnology.
> Molecular Biotechnology Engineer.
> PhD Student (Biotechnology Program. UNAB, Chile)
> Computational Biology Lab (DLab)
> Center for Mathematical Modeling (CMM)
> Facultad de Ciencias Físicas y Matemáticas.
> Universidad de Chile.