Difference between revisions of "Get names of type"

From PyMOLWiki
Jump to navigation Jump to search
(moved from get_names page (edit by User:Harijay))
 
(update object types (from ExecutiveGetType))
Line 12: Line 12:
 
* object:map
 
* object:map
 
* object:mesh
 
* object:mesh
* object:distance
+
* object:slice
 +
* object:surface
 +
* object:measurement
 +
* object:cgo
 +
* object:group
 +
* object:volume
 
* selection
 
* selection
  

Revision as of 07:12, 4 April 2012

get_names_of_type returns a list of object and/or selection names.

PYMOL API

cmd.get_names_of_type(string type)

NOTES

The object types are strings such as

  • object:molecule
  • object:map
  • object:mesh
  • object:slice
  • object:surface
  • object:measurement
  • object:cgo
  • object:group
  • object:volume
  • selection

EXAMPLES

Truncate names of all molecules

# Get names for all molecules.
for x in cmd.get_names_of_type("object:molecule"): cmd.set_name(x,x[:5])

SEE ALSO

get_names, get_type, count_atoms, count_states