From: Axel Kohlmeyer (
Date: Sat Jun 15 2013 - 16:39:42 CDT

On Fri, Jun 14, 2013 at 7:56 PM, Chavent Mathieu <> wrote:
> Dear VMD users/developers,
> I have a little question about the graphics command line. I am storing graphics info using the command line:
> set graph_prim [graphics $molid info $element_id]
> Then I would like to reuse this value to recreate the primitive later. To do this I tried:
> graphics $molid $graph_prim
> I obtain the error: graphics: not enough parameters
> So, I understand that tcl/vmd code cannot interpret the information in the variable $graph_prim but I cannot find a simple way to fix this problem. My final goal is to hide/show a primitive when I am clicking on a list - like the list in the graphical representations window -

the problem is that "graphics $molid info $element_id" returns a list,
which counts as one argument not multiple. a way to work around this
would be:

eval [concat "graphics $molid" $graph_prim]

this combines the list with the additional pieces into one long list
(which is internally in Tcl also one long string, so you can make a
regular command from it using the eval command.

> When I click on the list I replace the graphical element by a phantom primitive when I click again I would like to recreate the primitive using the info stored. Maybe my idea is not the good one so if you have another solution I am also interested.
> Thank you very much in advance!
> Best Regards,
> Matthieu

Dr. Axel Kohlmeyer
International Centre for Theoretical Physics, Trieste. Italy.