objects: Manage objects in selection

The objects module keeps track of collections of objects. The most common use is for parsing atom specifiers and tracking what atoms and bonds match.

class Objects(atoms=None, bonds=None, pseudobonds=None, models=None)

Bases: object

Objects is a collection of models and subparts of models such as atoms. They are produced by evaluating command specifiers.

Objects also can include model instances. Currently models and model instances are independent parts of the collection. Probably models and model instances should always contain exactly the same models. But the current semantics are unclear. Models with atoms appear in the models set even if not all the atoms are in the Objects collection. This needs more thought.


atoms : Atoms object

bonds : Bonds object

pseudobonds : Pseudobonds object

models : readonly list of chimerax.core.models.Model

add_atoms(atoms, bonds=False)

Experimental API . Add atoms to collection. If bonds is true also add bonds between specified atoms.


Experimental API . Add bonds to collection.


Experimental API . Add model to collection.

add_model_instances(m, imask)

Experimental API . Add model instances to collection.


Experimental API . Add pseudobonds to collection.


Experimental API . Return Objects containing only displayed atoms, bonds, pseudobonds and models.