On Jan 4, 2019, at 10:34 AM, Elaine Meng <meng@cgl.ucsf.edu> wrote:

I believe that group/ungroup models is only in the Model Panel.  Undoubtedly it could be done with python, but someone else would have to help with that.

Indeed you need to use Python.  In Python, assuming you had the models you wanted to group in a variable named “models”, it would be:

from ModelPanel import groupCmd
groupCmd(models, name=“group name”)

You can obtain a list of all open models from Chimera’s “openModels” variable, e.g.:

from chimera import openModels
allModels = openModels.list()

Every model has a ‘name’ attribute, and ‘id’ attribute containing the main model ID number and ‘subid’ containing the sub-ID number, if any.  Therefore you could get a list of all models whose name starts with ‘exp1_’ with:

from chimera import openModels
models = [m.name.startswith(“exp1_”) for m in openModels.list()]

This whole process may be easy or quite difficult, depending on your pre-existing familiarity with working with Chimera’s Python.

—Eric

Eric Pettersen
UCSF Computer Graphics Lab