<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ziv28</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ziv28"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/Ziv28"/>
	<updated>2026-06-19T15:18:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Distance&amp;diff=3599</id>
		<title>Distance</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Distance&amp;diff=3599"/>
		<updated>2007-12-04T16:27:00Z</updated>

		<summary type="html">&lt;p&gt;Ziv28: /* USAGE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===DESCRIPTION===&lt;br /&gt;
'''distance''' creates a new distance object between two selections.  It will display all distances within the cutoff.&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
 distance &lt;br /&gt;
 distance (selection1), (selection2)&lt;br /&gt;
 example: dist i. 158 and n. CA, i. 160 and n. CA &lt;br /&gt;
&lt;br /&gt;
 distance name = (selection1), (selection2) [,cutoff [,mode] ]&lt;br /&gt;
 &lt;br /&gt;
 name = name of distance object &lt;br /&gt;
 selection1, selection2 = atom selections&lt;br /&gt;
 cutoff = maximum distance to display&lt;br /&gt;
 mode = 0 (default)&lt;br /&gt;
&lt;br /&gt;
===PYMOL API===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.distance( string name, string selection1, string selection2,&lt;br /&gt;
              string cutoff, string mode )&lt;br /&gt;
   # returns the average distance between all atoms/frames&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===NOTES===&lt;br /&gt;
The distance wizard makes measuring distances easier than using the &amp;quot;dist&amp;quot; command for real-time operations.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;dist&amp;quot; alone will show distances between selections (pk1) and (pk1), which can be set using the PkAt mouse action (usually CTRL-middle-click). &lt;br /&gt;
&lt;br /&gt;
===EXAMPLES===&lt;br /&gt;
*This neat example shows how to create distance measurements from an atom in a molecule to all other atoms in the molecule (since PyMol supports wildcards).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
 cmd.dist(&amp;quot;(/mol1///1/C)&amp;quot;,&amp;quot;(/mol1///2/C*)&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or written without the PyMolScript code,&lt;br /&gt;
 dist /mol1///1/C, /mol1///2/C*&lt;br /&gt;
&lt;br /&gt;
*Create multiple distance objects&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for at1 in cmd.index(&amp;quot;resi 10&amp;quot;): \&lt;br /&gt;
   for at2 in cmd.index(&amp;quot;resi 11&amp;quot;): \&lt;br /&gt;
       cmd.dist(None, &amp;quot;%s`%d&amp;quot;%at1, &amp;quot;%s`%d&amp;quot;%at2)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SEE ALSO===&lt;br /&gt;
[[Measure_Distance]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|distance]]&lt;/div&gt;</summary>
		<author><name>Ziv28</name></author>
	</entry>
</feed>