VMD-L Mailing List
From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Mon Feb 21 2011 - 17:14:58 CST
- Next message: David Joiner: "Re: Compiling on Windows"
- Previous message: Phelan Jr., Frederick R. Dr.: "Drawing using variables"
- In reply to: Phelan Jr., Frederick R. Dr.: "Drawing using variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
On Mon, Feb 21, 2011 at 5:01 PM, Phelan Jr., Frederick R. Dr.
<frederick.phelan_at_nist.gov> wrote:
> I am trying to define a script to draw a geometry using variables. The
> script contains commands like:
>
>
>
> set xmax 100
>
> …
>
> draw line {0 0 0} {$xmax 0 0}
{ } is a literal quote.
no expansion of variables will happen.
you have to use:
"$xmax 0 0"
or
[list $xmax 0 0]
this is standard Tcl stuff. have a look at the Tcl
tutorial on www.tcl.tk. it is really good and will
give many examples to understand these subtleties
(and tips how to do things efficiently).
cheers,
axel.
>
>
>
> However, the execution of the draw line command gives:
>
>
>
> vmd > draw line {0 0 0} {$xmax 0 0}
>
> expected floating-point number but got "$xmax" ßerror message
>
>
>
> Also tried,
>
>
>
> vmd > draw line {0 0 0} {expr $xmax 0 0}
>
> need three numbers for a vector
> ßerror message
>
>
>
> as well as numerous other variations. I guess this is a Tcl error I am
> getting … can anyone help me with the syntax?
>
>
>
> Thanks,
>
> Fred
>
>
>
>
>
>
>
> ________________________________
>
> Frederick R. Phelan Jr., Ph.D.
> Complex Fluids Group
> Polymers Division
> National Institute of Standards and Technology
>
> ________________________________
>
> NIST, Bldg. 224/Rm. A209
> 100 Bureau Dr., STOP 8542
> Gaithersburg, MD 20899-8542
> 301.975.6761 (VOX)
> 301.975.4924 (FAX)
> Frederick.Phelan_at_nist.gov
>
> My Polymers Home Page
>
>
>
-- Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0 Institute for Computational Molecular Science Temple University, Philadelphia PA, USA.
- Next message: David Joiner: "Re: Compiling on Windows"
- Previous message: Phelan Jr., Frederick R. Dr.: "Drawing using variables"
- In reply to: Phelan Jr., Frederick R. Dr.: "Drawing using variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]