From: Joao Ribeiro (
Date: Thu Jul 11 2019 - 09:23:32 CDT

Dear Surya,


So, to correctly do what you want, you do need to correct a few things. Here is the fixed loop


for {set x 17} {$x > 8} {incr x -1} {

    $sel moveby [list 0 0 $x]

    $sel writexyz Sep_$



If you do “{0 0 $x}”, the “$x” never gets assigned with the value of the variable x; you cannot increment floating numbers, please use integer or increment the floating numbers manually inside the loop. I don’t know you have defined the sel1 variable in previous lines but is not set in the lines that you sent us.


I hope this helps.






From: <> on behalf of surya narayanan chandrasekaran <>
Date: Thursday, July 11, 2019 at 5:36 AM
To: <>
Subject: vmd-l: vmd moveby command inside loop



       I was trying a simple for loop inside my script that need to give variable to move command.


for {set x 17.1} {$x > 8} {incr x - 1} {
    $sel moveby {0 0 $x}
    $sel1 writexyz Sep_$


But I am getting error. "atomselection moveby: translation vector can only be of length 3" or

"atomselect moveby: non-numeric in vector"


I tried "$x", puts, [expr $x]


Warm regards,