From: Schreiner Eduard (eschrein_at_ks.uiuc.edu)
Date: Tue Jul 22 2008 - 11:01:39 CDT

Hi Ignacio,

related questions appeared already in the vmd-l.
You may wish to check Axel's mail on "selecting a cylindrical slab".
For your convenience I paste below the for you relevant part

"
what you need is
something like

sqrt(x*x + y*x) < 10.0

or if you want the cylinder around x=2 and y=-3:

sqrt((x-2)*(x-2) + (y+3)*(y+3)) < 10.0

think about it for a bit and it will become evident. ;-)

"
However, if your molecule is not aligned to the main axes or
rotates, this will be pretty involved.
So you may first to want to align your entire system to the main axes
(in the example above you would select along the z axis)

eddi

On Jul 22, 2008, at 6:30 AM, Ignacio Fernández Galván wrote:

> Hi all,
>
> I have a system consisting of an aromatic molecule and number of
> solvent molecules. I'd like to select the solvent molecules which
> are more or less solvating both sides of the benzene ring, that is,
> located perpendicular to the plane of the ring and at a distance of
> say 4Ĺ at most.
>
> Just using the "within" keyword is not enough, because it selects
> based on a spherical cutoff, and I want a kind of cylindrical
> region. I got more or less what I want by using "(within 4 of C1)
> and (within 4 of C3) and (within 4 of C5)", where C1, C3 and C5 are
> the atoms in the benzene ring, this somewhat limits adequately the
> region, but this region gets narrower the farther from the ring it
> is, and that's not quite it.
>
> So, I decided to take it the hard way and play with the
> coordinates, thinking I could select all atoms whose distance to C1
> is smaller than to H1, to C2 smaller than to H2, etc. But now the
> problem is... how can I reference the coordinates of specific atoms
> dynamically (they should be updated each frame)? If that's not
> possible, I'd have to store the coordinates in variables, which I
> did with "set xA [[atomselect 0 "index 0"] get x]", for instance,
> and then use $xA in the selection... but I must be doing something
> wrong, because it does not work: it behaves as if $xA = 0, although
> "puts $xA" says otherwise.
>
> I must be doing something wrong now, I'd be grateful for any help.
>
> Thanks,
> Ignacio
>
>
> __________________________________________________________
> Not happy with your email address?.
> Get the one you really want - millions of new email addresses
> available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html