From: Nuno Ricardo Loureiro Ferreira (
Date: Fri Dec 15 2006 - 10:42:36 CST

Hi Mohamed

I did write some time ago the following proc (or saw them somewhere), don't recall.

# translates molid by $trans angstrons along $axis
# e.g. translation top x 10
proc translation { molid axis trans } {
  set sel [atomselect $molid "all"]
  if {$axis == "x"} {set a $trans; set b 0; set c 0}
  if {$axis == "y"} {set a 0; set b $trans; set c 0}
  if {$axis == "z"} {set a 0; set b 0; set c $trans}
  $sel move [transoffset "$a $b $c" ]

And BTW, a proc that rotates the molecule

# rotates molid by $angle degrees around $axis
# e.g. rotation 2 z 45
proc rotation { molid axis angle } {
  set sel [atomselect $molid "all"]
  $sel move [transaxis $axis $angle]

Try them.
What version of VMD are you using? I do not see why moveby cmd is not working.


  ----- Original Message -----
  From: Mohamed Osman
  Sent: Friday, December 15, 2006 3:36 PM
  Subject: vmd-l: moveby command in vmd

  I am using moveby command to shift coordinates of all atoms in pdb file. Here is how I use it in a tcl file

  set all [atomselect top all]
  $all moveby {0 0 10}
  $all writepdb outfile.pdb

  I get an error message: invalid command name "moveby"

  Info) Analyzing structure ...
  Info) Atoms: 2685
  Info) Bonds: 2764
  Info) Residues: 345
  Info) Waters: 2
  Info) Segments: 6
  Info) Fragments: 9 Protein: 4 Nucleic: 0
  invalid command name "moveby"

  Mohamed Osman