From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Wed Feb 20 2008 - 12:05:29 CST

On Wed, Feb 20, 2008 at 11:22 AM, Pavan Ghatty <pavan.vmd_at_gmail.com> wrote:
> Hello All,
> Why wont the following selection work in VMD? I want to look at water
> molecules whose x>min_x of the protein. I will then add further constraints
> to the box.
> I typed
> expr [lindex [lindex [measure minmax [atomselect top protein]] 0] 0] in the
> TCL console and got say, -23.22
> I then typed
> water and x> expr -23 {I could have used x>-23} in the graphical
> representations and that worked fine. So expr -23 returns a number and not a
> string.
> But neither,
> water and x> expr [lindex [lindex [measure minmax [atomselect top protein]]
> 0] 0]
> nor

the selection text field accepts a selection string but is not evaluating
tcl code, so what you want to do cannot be done this way. you need
to find some other way to hook the calculation into the animation loop,
this can be done with tracing $vmd_frame($molid).
see http://www.theochem.rub.de/~axel.kohlmeyer/cpmd-vmd/part4.html#chap6_sect3
for a couple of examples.

cheers,
    axel.
a look at what is done at

> water and x> [lindex [lindex [measure minmax [atomselect top protein]] 0] 0]
> nor
> water and x> lindex [lindex [measure minmax [atomselect top protein]] 0] 0
>
> worked. Could you please help me out with this or suggest an alternative?
>
> Thanks!
> Pavan
>

-- 
=======================================================================
Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://www.cmm.upenn.edu
 Center for Molecular Modeling -- University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.