<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=GetNamesInSel</id>
	<title>GetNamesInSel - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=GetNamesInSel"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=GetNamesInSel&amp;action=history"/>
	<updated>2026-07-10T00:37:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=GetNamesInSel&amp;diff=5948&amp;oldid=prev</id>
		<title>Pyadmin: 7 revisions</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=GetNamesInSel&amp;diff=5948&amp;oldid=prev"/>
		<updated>2014-03-28T01:46:53Z</updated>

		<summary type="html">&lt;p&gt;7 revisions&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:46, 28 March 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pyadmin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=GetNamesInSel&amp;diff=5947&amp;oldid=prev</id>
		<title>Speleo3: get_object_list</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=GetNamesInSel&amp;diff=5947&amp;oldid=prev"/>
		<updated>2011-08-31T07:58:11Z</updated>

		<summary type="html">&lt;p&gt;get_object_list&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Overview =&lt;br /&gt;
This script returns the list of object names that exist in any given selection.  For example, if you have 100 objects loaded (viz. ligand poses from small molecule docking) and select all atoms w/in some cutoff, then you have a selection.  What objects are actually in that selection?  This script will tell you.&lt;br /&gt;
&lt;br /&gt;
= The Code =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pymol import cmd, stored&lt;br /&gt;
def getNamesInSel(sel, sorted=0, reversed=0, quiet=1):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    PARAMETERS&lt;br /&gt;
        sel,&lt;br /&gt;
            The selection, object or group to iterate over&lt;br /&gt;
        sorted (boolean),&lt;br /&gt;
            Should the list be sorted?&lt;br /&gt;
        reversed (boolean)&lt;br /&gt;
            Should the list be reversed before returned?  (Combined&lt;br /&gt;
            with the above, you can return a decreasing-sorted list&lt;br /&gt;
            of names&lt;br /&gt;
 &lt;br /&gt;
    RETURNS&lt;br /&gt;
        list[] of strings, representing the object names desired.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    rList = cmd.get_object_list('(' + sel + ')')&lt;br /&gt;
&lt;br /&gt;
    # if you want the list reversed or sorted,&lt;br /&gt;
    # uncomment the following lines&lt;br /&gt;
    if int(sorted):&lt;br /&gt;
        rList.sort()&lt;br /&gt;
    if int(reversed):&lt;br /&gt;
        rList.reverse()&lt;br /&gt;
&lt;br /&gt;
    if not int(quiet):&lt;br /&gt;
        print ' getNamesInSel: ', rList&lt;br /&gt;
&lt;br /&gt;
    return rList&lt;br /&gt;
&lt;br /&gt;
cmd.extend(&amp;quot;getNamesInSel&amp;quot;, getNamesInSel)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[Get_Names]]&lt;br /&gt;
* [[get_object_list]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;br /&gt;
[[Category:ObjSel_Scripts]]&lt;/div&gt;</summary>
		<author><name>Speleo3</name></author>
	</entry>
</feed>