.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OESetDistance

.. oe:function:: OESetDistance

   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OESetDistance(OEMolBase& mol, OEAtomBase* a, OEAtomBase* b,
                            double dist)

   .. oe:language:: python

      .. oe:api:: python

         OESetDistance(mol: Union[OEGraphMol,OEMol,OEQMol], a: OEAtomBase,
                       b: OEAtomBase, dist: float) -> bool


   Sets the distance between two atoms to the value specified by the argument `dist`.
   The two atoms must be bonded together.  The atom passed in as `b` is displaced.
   If the bond defined by atoms is in a ring, no change to the distance will occur.
   The function returns ``true`` if it completes successfully.  The function returns 
   ``false`` if the atoms do not form a bond, if the bond is part of a ring, or if 
   the atoms are on top of each other.
   
   *mol*
      The molecule that the pair of atom belongs to.

   *a*
      The first atom.

   *b*
      The second atom.

    *dist*
      The distance.

