From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Sun Oct 11 2015 - 09:53:37 CDT

On Sat, Oct 10, 2015 at 9:34 PM, Ebert Maximilian <m.ebert_at_umontreal.ca>
wrote:

> Hi,
>
> that means that I need to keep the position vectors. Not ideal but fine. I
> have every graphics in an empty molecule so I will simply delete the
> molecule and add a new empty molecule and re-draw the graphics. Too bad
> that graphics object are not treated as atoms.
>

​i disagree with that conclusion. monitoring graphics ids is very much like
referring to atoms by index. i'm using this approach in several plugins and
scripts that add dynamic graphics to trajectories and it works very well
and allows to selectively add, remove objects or update objects *without*
having to redraw everything. for complex objects that removes annoying
flicker during animating frames and it is more efficient as well.

axel.​

>
> Thanks,
>
> Max
>
> > On Oct 8, 2015, at 3:11 PM, Ebert Maximilian <m.ebert_at_umontreal.ca>
> wrote:
> >
> >
> >
> >
> > ________________________________________
> > From: John Stone
> > Sent: Thursday, October 08, 2015 3:11:16 PM (UTC-05:00) Eastern Time (US
> & Canada)
> > To: Ebert Maximilian
> > Cc: <vmd-l_at_ks.uiuc.edu>
> > Subject: Re: vmd-l: Change color of drawn object
> >
> > Hi,
> > You can use the lower level "graphics replace" command to delete
> > a particular graphics command ID with a subsequently added graphics
> command.
> > To do this, you have to keep track of the graphics command IDs returned
> > when you run your 'draw' or 'graphics' commands. The User's Guide
> > discusses this, although the description could be improved quite a bit.
> >
> > Cheers,
> > John Stone
> > vmd_at_ks.uiuc.edu
> >
> > On Thu, Oct 08, 2015 at 06:48:07PM +0000, Ebert Maximilian wrote:
> >> Hi,
> >>
> >> is there a way to change the color of a drawn object if this object has
> a molecule ID of its own. Example
> >>
> >> mol new
> >> mol rename top new-object
> >> draw color red
> >> draw sphere {0,0,0}
> >>
> >> How to change the sphere to green?
> >>
> >> Thanks
> >
> > --
> > NIH Center for Macromolecular Modeling and Bioinformatics
> > Beckman Institute for Advanced Science and Technology
> > University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> > http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> > http://www.ks.uiuc.edu/Research/vmd/
>
>
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.