From: Maxim Belkin (mbelkin_at_ks.uiuc.edu)
Date: Fri Oct 10 2014 - 13:12:45 CDT

set myResVariable [[atomselect top "<selection text>"] get resname]

Be careful with undeleted atomselections if you do it in a loop.
Use [atomselect list] to see what selections you've already made.

> On Oct 10, 2014, at 12:58 PM, mason H <tailermason_at_gmail.com> wrote:
>
> hello,
> I would like to set a variable with a resname from a protein residue.
>
> I can easily do
> set sel1 [atomselect top "segname SegA and resid 101"]
>
> and I can do
> [atomselect top "segname SegA and resid 101"] get resname
> to get the resname
>
> ..But how can I get something like this to work:
> set myResVariable [atomselect top "segname SegA and resid 101"] get resname
>
> Thank you
>
>
>