From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Dec 09 2016 - 14:32:31 CST

Hi,
  Your strategy for generating a load script would work except that
the rep IDs for a given "molecule" add up, so if you show two reps
for one of the cube files, then you'd need to keep track of that rep
count so that you use the right indices for the next cube file loaded
into the same molecule. If you load all of the cube files into different
molecules, then they'll each start from rep ID 0 again. You don't strictly
need to set the clip planes unless you're using them. The save state script
does this because the user might have had them enabled in a previous
session or a similar scenario, but in your case I would omit the clipplane
related commands entirely. Let us know if you need more guidance on this.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Dec 06, 2016 at 06:49:47PM +0100, Ignacio Fernández Galván wrote:
> Hello,
>
> I don't understand this. I've created a "visualization state" file with
> VMD (1.9.1), after loading a bunch of .cube files with volumetric data
> and creating representations. I can reload this file with "vmd -e
> file.vmd", no problem.
>
> Now I want to modify the file for another set of .cube files, mostly the
> same structure, but now some "molecules" have a different number of
> representations. Instead of re-creating everything from the GUI, I just
> edit the text file, it should be pretty easy: change filenames, remove
> or duplicate the stuff that creates representations and that's it. Well,
> it works, except when I have some molecule with more representations
> than before, then I get "Invalid repid specified", which apparently
> corresponds to the part of the script where it sets clip planes. So I
> have something like this in the .vmd file:
>
> ..
> mol clipplane status 5 4 top {0}
> mol showrep top 4 0
> mol representation Isosurface 0.020000 2 0 0 1 1
> mol color ColorID 10
> mol selection {all}
> mol material Translucent
> mol addrep top
> mol selupdate 5 top 0
> mol colupdate 5 top 0
> mol scaleminmax top 5 0.000000 0.000000
> mol smoothrep top 5 0
> mol drawframes top 5 {now}
> mol list top
> mol clipplane center 0 5 top {0.0 0.0 0.0}
> ..
>
> the first two lines were already there, they correspond to the last
> "previously existing" representation. From there, I just copied the
> lines from another molecule that already had rep #5. The "mol list top"
> line I added for debugging. When I load this I get in the terminal:
>
> ..
> Status of molecule 9-1_-0.16.cube:
> 9-1_-0.16.cube Atoms:10 Frames (C): 4(3) Status:ADfT
> Atom representations: 6
> 0: on, 9 atoms selected.
> Coloring method: Name
> Representation: CPK 0.300000 0.100000 10.000000 10.000000
> Selection: not name X
> 1: on, 10 atoms selected.
> Coloring method: ColorID 10
> Representation: Isosurface 0.020000 0 0 0 1 1
> Selection: all
> 2: on, 10 atoms selected.
> Coloring method: ColorID 15
> Representation: Isosurface -0.020000 0 0 0 1 1
> Selection: all
> 3: on, 10 atoms selected.
> Coloring method: ColorID 3
> Representation: Isosurface 0.020000 1 0 0 1 1
> Selection: all
> 4: on, 10 atoms selected.
> Coloring method: ColorID 14
> Representation: Isosurface -0.020000 1 0 0 1 1
> Selection: all
> 5: on, 10 atoms selected.
> Coloring method: ColorID 10
> Representation: Isosurface 0.020000 2 0 0 1 1
> Selection: all
>
> Invalid repid specified:5
> Invalid repid specified:5
> Invalid repid specified:5
> Invalid repid specified:5
> Invalid repid specified:5
> Invalid repid specified:5
> ..
>
> Huh? repid 5 invalid, and it was just listed above? I can't find what's
> wrong. Is there anywhere else in the script where the representations
> are allocated or something like that? Anyway, one the file is loaded
> everything seems to work as expected (but I'm not using clip planes).
>
> Thank you,
> Ignacio

-- 
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/