From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Oct 03 2006 - 14:35:50 CDT

Hi,
  I think you'll find it much easier to use the built-in
'$sel moveby' and '$sel move' subcommands, rather than creating your own.
See the examples in the bottom half of the User's Guide page here:
  http://www.ks.uiuc.edu/Research/vmd/current/ug/node181.html#14252

Your moveby proc looks like it's from that page, but the later
examples are the better way to do it.

For your rotations, you'll need to use the '$sel move [transaxis x 90]'
way of doing things. The 'rotate x by 45' doesn't actually affect the
atom coordinates, it only rotates the _view_ of the structure, and thus
will not affect the structure you're saving.

  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Oct 03, 2006 at 02:02:41PM -0500, Cesar Millan wrote:
> Hi everyone, I trying to move a coordinates and save the changes on a new
> file but when I look on the new coordinates, the coordinate values are the
> same :S, here is what I'm doing:
>
> ###
> animate read pdb lig1.pdb
>
> proc moveby {sel offset} {
> foreach coord [$sel get {x y z}] {
> lappend newcoords [vecadd $coord $offset]
> }
> $sel set {x y z} $newcoords
> }
>
> set sel [atomselect top "all"]
>
> set v 1
> while { $v <= 5 } {
> moveby $sel "5 0 0"
> set $sel [atomselect top "all"]
> $sel writepdb lig1_${v}.pdb
> rotate z by 45
> moveby $sel "-5 0 0"
> incr v
> }
>
> when I watch the coordinates on lig1_*.pdb, they are the same as the
> original, does anyone know what happend?
>
> thank you so much.
>
> --
> César Millán Pacheco
> Facultad de Ciencias
> Universidad Autonoma del Estado de Morelos
> Tel: 777 3297020
> Fax: 777 3207040
> email: cmp_at_servm.fc.uaem.mx
> pachequin_at_gmail.com

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078