obj method retrieves an object (MolCoord, etc) by its name or ID from the current active scene.

 o = cm.obj("1CRN.pdb") # get object by its name
 o = cm.obj(12) # get object by its ID

By giving scene name (or ID or scene itself), you can get object from the specific scene.

 o = cm.obj("1CRN.pdb", s) # get object "1CRN.pdb" from scene referenced by s
 o = cm.obj("1CRN.pdb", "Scene 1") # get object "1CRN.pdb" from scene "Scene 1"

Retrieving object by name

User can set non-unique (i.e. same) names to different objects. In such cases, obj() method returns an object with the smallest ID having the specified name.

back to index

Last-modified: Tue, 11 Jul 2017 15:49:27 JST (42d)