.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEBondIsInRingSize

.. oe:function:: OEBondIsInRingSize

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

      .. oe:api::

         bool OEBondIsInRingSize(const OEBondBase* bnd, unsigned int size)
         bool OEBondIsInRingSize(const OEBondBase& bnd, unsigned int size)

   .. oe:language:: python

      .. oe:api:: python

         OEBondIsInRingSize(bnd: OEBondBase, size: int) -> bool

   Determines whether the given bond is in a cycle of the specified size.
   If the bond is not in a ring, *i.e.* :oe:meth:`OEChem::OEBondBase::IsInRing`
   returns ``false``, then this function also returns ``false``.
   This function also returns ``false`` for all values for size less than three.

   .. warning::

      It is necessary to perform ring perception by calling
      :oe:func:`OEChem::OEFindRingAtomsAndBonds` function prior to calling
      :oe:func:`OEChem::OEBondIsInRingSize` function.

   .. seealso::

      * :ref:`chapter_ring` chapter

