From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Mar 20 2007 - 22:33:34 CDT

Hi,
  In order to draw graphics into the multiple separate molecules,
independent of whatever molecule is currently "top", you'll want to
replace the "draw" commands with their "graphics" equivalents.
(the "draw" commands are nothing more than Tcl procs that call
 the equivalent "graphics" commands and have "top" hard coded as
 the molecule ID. VMD includes the "draw" commands to make it easier
 to write simple scripts...)
In cases like this it's best to specify the molecule IDs yourself so
that you are only performing updates on the appropriate molecules.
The VMD User's Guide describes the syntax for the "graphics" commands.

  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Mar 20, 2007 at 11:08:32PM -0400, Myunggi Yi wrote:
> Can anybody help me?
> I can delete and update the arrows of only one molecule
> which is "top".
> How can I update arrows of two molecules at the same time?
>
>
> On 3/20/07, Myunggi Yi <myunggi_at_gmail.com> wrote:
> >I can't delete the arrows on the second molecule,
> >and I want to play two trajectories at the same time
> >for making movie.
> >
> >On 3/20/07, John Stone <johns_at_ks.uiuc.edu> wrote:
> >> Hi,
> >> Have you tried taking the "draw delete all" out of both
> >> versions of the script to make sure that they aren't interfering
> >> with each other? Were you running these one at a time or both
> >> concurrently?
> >>
> >> John Stone
> >> vmd_at_ks.uiuc.edu
> >>
> >> On Tue, Mar 20, 2007 at 09:09:06PM -0400, Myunggi Yi wrote:
> >> > Dear VMD users,
> >> >
> >> > I have modified a script from the image-movie tutorial (pore.tcl)
> >> > to display two molecules in a window at the same time.
> >> >
> >> > The following is the script.
> >> > If I add arrows in the second molecule, I can't display any arrows.
> >> > Would you give me a hand?
> >> >
> >> >
> >> > proc enabletrace {} {
> >> > global vmd_frame
> >> > trace variable vmd_frame([molinfo top]) w drawcounter
> >> > }
> >> >
> >> > proc disabletrace {} {
> >> > global vmd_frame
> >> > trace vdelete vmd_frame([molinfo top]) w drawcounter
> >> > }
> >> >
> >> > proc enabletrace2 {} {
> >> > global vmd_frame2
> >> > trace variable vmd_frame(1) w drawcounter2
> >> > }
> >> >
> >> > proc disabletrace2 {} {
> >> > global vmd_frame2
> >> > trace vdelete vmd_frame(1) w drawcounter2
> >> > }
> >> >
> >> > set pore_draw_arrows 0
> >> >
> >> > proc enablearrows {} {
> >> > global pore_draw_arrows
> >> > set pore_draw_arrows 1
> >> > }
> >> >
> >> > proc disablearrows {} {
> >> > global pore_draw_arrows
> >> > set pore_draw_arrows 0
> >> > }
> >> >
> >> > proc vmd_draw_arrow {mol start end} {
> >> > # an arrow is made of a cylinder and a cone
> >> > set end [vecadd $start [vecscale 1.5 [vecsub $end $start]]]
> >> > set coneEnd [vecadd $end [vecscale 0.25 [vecsub $end $start]]]
> >> > graphics $mol cylinder $start $end radius 0.5
> >> > graphics $mol cone $end $coneEnd radius 1.0
> >> > }
> >> >
> >> > proc drawcounter { name element op } {
> >> > global vmd_frame
> >> > global pore_draw_arrows
> >> >
> >> > draw delete all
> >> > draw material Opaque
> >> >
> >> > # Draw the arrows
> >> > if { $pore_draw_arrows } {
> >> > for { set id 1 } { $id < 6 } { incr id } {
> >> > set tmpSel1 [atomselect 0 "segid $id and resid 51 200 and
> >name
> >> > CA" \
> >> >
> >> > frame $vmd_frame([molinfo top])]
> >> > foreach {coorIN coorOUT} [$tmpSel1 get "x y z"] { break }
> >> >
> >> > draw color black
> >> > vmd_draw_arrow top $coorOUT $coorIN
> >> >
> >> > $tmpSel1 delete
> >> > }
> >> > }
> >> > }
> >> >
> >> > proc drawcounter2 { name element op } {
> >> > global vmd_frame2
> >> > global pore_draw_arrows
> >> >
> >> > # draw delete all
> >> > draw material Opaque
> >> >
> >> > # Draw the arrows
> >> > if { $pore_draw_arrows } {
> >> > for { set id 1 } { $id < 6 } { incr id } {
> >> > set tmpSel2 [atomselect 1 "segid $id and resid 51 200 and
> >name
> >> > CA" \
> >> >
> >> > frame $vmd_frame(1)]
> >> > foreach {crdIN crdOUT} [$tmpSel2 get "x y z"] { break }
> >> >
> >> > draw color black
> >> > vmd_draw_arrow 1 $crdOUT $crdIN
> >> >
> >> > $tmpSel2 delete
> >> > }
> >> > }
> >> > }
> >> >
> >> >
> >> > --
> >> > Best wishes,
> >> >
> >> > MYUNGGI YI
> >>
> >> --
> >> NIH Resource for Macromolecular Modeling and Bioinformatics
> >> Beckman Institute for Advanced Science and Technology
> >> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> >> Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> >> WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
> >>
> >
> >
> >--
> >Best wishes,
> >
> >MYUNGGI YI
> >==================================
> >KLB 419
> >Institute of Molecular Biophysics
> >Florida State University
> >Tallahassee, FL 32306
> >
> >Office: (850) 645-1334
> >http://www.scs.fsu.edu/~myunggi
> >
>
>
> --
> Best wishes,
>
> MYUNGGI YI

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078