From: Andrés Morales (h.andres.m1986_at_gmail.com)
Date: Thu Nov 24 2011 - 10:38:15 CST

Hi Sajad!

What do you mean with proper selection?

I also tried with the following protocols (the first one is like the one
suggested for moveby function in the VMD User's Guide):

proc change {sel M} {

    set newcoords {}
    foreach coord [$sel get {x y z}] {
    set new [coordtrans [transtranspose $M] $coord]
    lvarpush newcoords $new
    }
    $sel set $newcoords
    }

and

proc chage {sel M} {

    set newcoords {}
    foreach atom [$sel get index] {
     set coord [lindex [[atomselect top "index $atom"] get {x y z}] 0]
    set new [coordtrans [transtranspose $M] $coord]
    lvarpush newcoords $new
    }
    $sel set $newcoords
    }

But I get the error:

atomselection: improper method: set
usage: <atomselection> <command> [args...]

I hope some one could help me.

Thank

Andres

2011/11/24 sajad falsafi <sajad.falsafi_at_yahoo.com>

> Hi,
>
> this process can't get the atomic coordinates ({x y z}). maybe you didn't
> use the proper selection.
>
>
> Best of luck,
> Sajad Falsafi
> Dept. of Genetics, Shahid Chamran University of Ahvaz
> Toxicology Research Center, Jondi-Shapour University of Medical Sciences
>
>
>
> --- On Thu, 11/24/11, Andrés Morales <h.andres.m1986_at_gmail.com> wrote:
>
> > From: Andrés Morales <h.andres.m1986_at_gmail.com>
> > Subject: vmd-l: Change coordinates
> > To: vmd-l_at_ks.uiuc.edu
> > Date: Thursday, November 24, 2011, 11:44 AM
> > Dear VMD users:
> > I am trying to to replace the coordinates of a
> > selections with other coordinates I calculated before. The
> > new coordinates were calculated using an specific matrix I
> > defined before.
> > I am using the following protocol:
> > proc change {sel M} {
> >
> > foreach atom [$sel get index] {
> > set pos [lindex [[atomselect top "index
> > $atom"] get {x y z}] 0]
> > lvarpush newpos [coordtrans [transtranspose $M] $pos]
> > }
> > $sel set $newpos
> >
> > }
> >
> > When I use this protocol with somethin like : change $sel
> > $A,
> > I get the mistake: can't read "x": no
> > such variable
> >
> > Does anybody know how can I solve it?
> > Any suggestions?
> >
> > Thanks
> >
> >
> > Andres
> >
> >
>