.. include:: ../substitutions

.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OEGetNearbyBond

.. oe:function:: OEGetNearbyBond

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

      .. oe:api::

         OEDepict::OENearestBond OEGetNearbyBond(const OE2DActiveSiteDisplay& disp,
                                                 const OEDepict::OE2DPoint& point,
                                                 double radiusscale = 1.0)

   .. oe:language:: python

      .. oe:api:: python

         OEGetNearbyBond(disp: OE2DActiveSiteDisplay, p: OE2DPoint,
                         radiusscale: float = 1.0) -> OENearestBond

   Returns an :ref:`OENearestBond <OEDepict_OENearestBond>` object that stores a pointer
   of the bond which is depicted nearest to a given 2D display coordinates.
   By default, only atoms that not further than half bond away from the given
   point will be considered.

   *disp*
      The :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object of which atoms are being
      considered.

   *point*
      Specifies the 2D display coordinates.

   *radiusscale*
       The multiplier that can be used to increase or to decrease the
       radius around the given point to be considered.
       This value has to be in a range of :math:`[0.25, 2.0]`.

   .. note::

      If there is no bond close to the given display coordinates,
      then the :oe:meth:`OEDepict::OENearestBond::IsValid` method returns
      `false`.

   .. seealso::

      * :ref:`OENearestBond <OEDepict_OENearestBond>` class
      * :oe:func:`OEGrapheme::OEGetNearestBond` function
