From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Thu Feb 13 2003 - 12:29:00 CST

Michele,

On Thu, Feb 13, 2003 at 12:11:16PM -0500, Michele Andrews - Contractor wrote:
> Hi,
>
> First I would like to say that VMD is a great program, I use it with a
> cavetracker and wand and the scientists that I work with love what I have
> done so far. I have two simple questions.
>
> First, I am trying to load a pdb file and do some simple rotations. Here is
> what I have so far:
>
> mol load pdb first.pdb
> mol delrep 0 top
> mol representation CPK 1.5 0.5 15.0 6.0
> mol color Name
> mol selection {all}
> mol material Opaque
> mol addrep top
> mol rename top {first.pdb}
> rotate x by 360 1
> wait 30
> rotate y by 360 1
> wait 30
> rotate z by 360 1
>
> I know in the users guide it says that wait will not act as expected in
> complex tcl scripts, but I thought this was not complicated since there
> were no loops involved. Am I using the right commands? I would like to
> eventually add more pdb files, not necessarily named in sequence order. As
> written I am getting only a portion of the x and y rotations.

There does seem to be a problem with the wait command. Here's a workaround
I've found: define a Tcl proc called eventloop:

proc eventloop { numupdates } {
  for { set i 0 } { $i < $numupdates } { incr i } {
    display update ui
  }
}

Then replace "wait 30" in your script with "eventloop 360". This will cause
VMD to complete 360 display updates before processing any more commands,
which will give your rotation exactly as much time as it needs to complete.

>
> Second, is there a way to associate more than one tool to the cavebuttons
> at one time? I tried loading several tool options at once, but only one
> cavebutton seems to respond.

I'm not sure we've ever tried this; someone else will get back to you
on that one.

Cheers,
Justin

>
> Thanks in advance,
> Michele

-- 
  Justin Gullingsrud        3111 Beckman Institute        217-244-8946
  I been dropping the new science, and I be kicking the new knowledge,
  and I'm seeing to a degree that you can't get in college.  -- b.boys