VMD-L Mailing List
From: Giacomo Fiorin (giacomo.fiorin_at_gmail.com)
Date: Thu Jul 11 2019 - 09:43:59 CDT
- Next message: WT Ren: "Re: failure of charge optimization by fftk"
- Previous message: Joao Ribeiro: "Re: vmd moveby command inside loop"
- In reply to: surya narayanan chandrasekaran: "vmd moveby command inside loop"
- Next in thread: surya narayanan chandrasekaran: "Re: vmd moveby command inside loop"
- Reply: surya narayanan chandrasekaran: "Re: vmd moveby command inside loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi, this is a Tcl syntax idiosyncrasy: the braces will treat their content
as a string literal, and prevent expanding the variable inside them. Try:
$sel moveby [list 0 0 $x]
Giacomo
On Thu, Jul 11, 2019 at 7:13 AM surya narayanan chandrasekaran <
sonofsunsurya_at_gmail.com> wrote:
> Hi,
> 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_$x.xyz
> }
>
> 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,
> Surya
>
-- Giacomo Fiorin Associate Professor of Research, Temple University, Philadelphia, PA Research collaborator, National Institutes of Health, Bethesda, MD http://goo.gl/Q3TBQU https://github.com/giacomofiorin
- Next message: WT Ren: "Re: failure of charge optimization by fftk"
- Previous message: Joao Ribeiro: "Re: vmd moveby command inside loop"
- In reply to: surya narayanan chandrasekaran: "vmd moveby command inside loop"
- Next in thread: surya narayanan chandrasekaran: "Re: vmd moveby command inside loop"
- Reply: surya narayanan chandrasekaran: "Re: vmd moveby command inside loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]