Difference between revisions of "Get Title"

From PyMOLWiki
Jump to navigation Jump to search
(→‎PYMOL API: change to get_title API (this was apparently copied from the set_title page))
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
===DESCRIPTION===
 
'''get_title''' retrieves a text string to the state of a particular object which will be displayed when the state is active.
 
  
===USAGE===
+
'''get_title''' retrieves a text string to the state of a particular object which will be displayed when the state is active. This is useful for printing the names of objects (given a state).
  set_title object,state
 
  
===PYMOL API===
+
==USAGE==
 
<source lang="python">
 
<source lang="python">
cmd.set_title(string object,int state,string text)
+
get_title object,state
 
</source>
 
</source>
  
[[Category:Commands|get_title]]
+
==PYMOL API==
[[Category:States]]
+
<source lang="python">
 +
cmd.get_title(string object, int state)
 +
</source>
 +
 
 +
== Example ==
 +
Print out all the object names of the ensemble of states loaded in:
 +
<source lang="python">
 +
for x in range(numStates):
 +
  print cmd.get_title("objName", x)
 +
</source>
 +
 
 +
[[Category:Commands|Get Title]]
 +
[[Category:States|Get Title]]

Latest revision as of 15:09, 19 January 2023

get_title retrieves a text string to the state of a particular object which will be displayed when the state is active. This is useful for printing the names of objects (given a state).

USAGE

get_title object,state

PYMOL API

 cmd.get_title(string object, int state)

Example

Print out all the object names of the ensemble of states loaded in:

for x in range(numStates):
  print cmd.get_title("objName", x)