From: Axel Kohlmeyer (
Date: Wed Jan 24 2007 - 10:26:55 CST

On Wed, 24 Jan 2007, Vivek Sharma wrote:

VS> Hi everyone,
VS> A little problem, actually, I am trying to define vectors (at arbitrary
VS> points) in space in VMD. Like,
VS> set temp_vector {1 2 3}, now in place of 1,2,3 i.e. x,y and z, I would like
VS> to put some variables, which are defined and are taking value from
VS> somewhere, specifically to say, set temp_vector {$a $b $c},can something of
VS> that kind be done in VMD? I couldnt make it work it like that atleast.


this is more of a TCL script question than a VMD problem.
a 'vector' in the VMD sense is simply a list of numbers and
a list in TCL is essentially a string with the elements separated
by spaces. now you can define strings with { } and everything
between the curly braces is taken literally or with " " and
then variables are expanded. so, please try:

set tmp_vector "$a $b $c"

VS> Please reply if you have any ideas, once again to say, I have to define many
VS> arbitrary vectors in space, without a pdb i.e. no lindex, etc.

to be perfectly correct, a vector defines only a direction,
so a vector in space would need a reference point, too. but
that is a different story. ;-)


VS> br,
VS> Vivek

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.