From: Jeffrey A Tibbitt (jtibbitt_at_hawaii.edu)
Date: Mon Jan 01 2018 - 20:16:26 CST

New Year's Day issue for an newbie veteran. I've used VMD for maybe 14
years, but not much in the last 7+ years or so, and my TCL is a little
rusty. I'm drawing a crystal lattice (basically a bunch of skinny
cylinders) using 'draw cylinder ...'. I can get the lattice drawn
correctly, and am now consolidating the code using a list containing each
pair of cylinder end coordinates and a foreach loop to go through them
all. I've tried a lot of different syntax. I'm not sure if using list /
foreach method and is bestBelow is the code and corresponding VMD
output. Does anyone spot my error(s)?

*TCL code:*

# SET EDGE LENGTHS AND RADIUS
set a0 0
set b0 0
set c0 0

set a1 3.24
set b1 $a1
set c1 [expr sqrt(2) * $a1]

# SET UNIT CELL CORNERS
set A100 "$a1 $b0 $c0"
set A000 "$a0 $b0 $c0"
set A110 "$a1 $b1 $c0"
set A010 "$a0 $b1 $c0"
set A001 "$a0 $b0 $c1"
set A101 "$a1 $b0 $c1"
set A111 "$a1 $b1 $c1"
set A011 "$a0 $b1 $c1"

# DRAW CELL 111
mol new
foreach x1 x2
[ list
$A000 $A100
$A100 $A110
$A110 $A010
$A010 $A000
$A001 $A101
$A101 $A111
$A111 $A011
$A011 $A001
$A000 $A001
$A100 $A101
$A110 $A111
$A010 $A011
]

{
  draw cylinder $x1 $x2 radius 0.05 resolution 50 filled no
}

*VMD Output:*
 536 ~/Desktop/ $vmd -e demo2.vmd
Info) VMD for MACOSXX86, version 1.9.3 (November 30, 2016)
Info) http://www.ks.uiuc.edu/Research/vmd/
Info) Email questions and bug reports to vmd_at_ks.uiuc.edu
Info) Please include this reference in published work using VMD:
Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual
Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.
Info) -------------------------------------------------------------
Info) Multithreading available, 4 CPUs detected.
Info) OpenGL renderer: Intel(R) HD Graphics 515
Info) Features: STENCIL MDE MTX NPOT PP PS GLSL(OVF)
Info) Full GLSL rendering mode is available.
Info) Textures: 2-D (16384x16384), 3-D (2048x2048x2048), Multitexture (8)
Info) Dynamically loaded 2 plugins in directory:
Info) /Applications/VMD.1.9.3.app/Contents/vmd/plugins/MACOSXX86/molfile
0
0
0
3.24
3.24
4.582051942088828
3.24 0 0
0 0 0
3.24 3.24 0
0 3.24 0
0 0 4.582051942088828
3.24 0 4.582051942088828
3.24 3.24 4.582051942088828
0 3.24 4.582051942088828
0
wrong # args: should be "foreach varList list ?varList list ...? command"
invalid command name "0 0 0"
invalid command name "
  draw cylinder $x1 $x2 radius 0.05 resolution 50 filled no
"

-- 
*Jeffrey A Tibbitt, PhD*
Chemistry Lecturer
University of Hawai'i - Maui College