From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Wed Jan 24 2007 - 10:26:55 CST

On Wed, 24 Jan 2007, Vivek Sharma wrote:

VS> Hi everyone,
VS>
VS> A little problem, actually, I am trying to define vectors (at arbitrary
VS> points) in space in VMD. Like,
VS>
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.

vivek,

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. ;-)

axel.

VS>
VS> br,
VS> Vivek
VS>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   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.