.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEAtomIsInRingSize

.. oe:function:: OEAtomIsInRingSize

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

      .. oe:api::

         bool OEAtomIsInRingSize(const OEAtomBase* atm, unsigned int size)
         bool OEAtomIsInRingSize(const OEAtomBase& atm, unsigned int size)

   .. oe:language:: python

      .. oe:api:: python

         OEAtomIsInRingSize(atm: OEAtomBase, size: int) -> bool

   Determines whether the given atom is in a cycle of the specified size.
   If the atom is not in a
   ring, *i.e.* :oe:meth:`OEChem::OEAtomBase::IsInRing` returns ``false``,
   then this function also returns ``false``.  This function also returns
   ``false`` for all values of 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::OEAtomIsInRingSize` function.

   .. seealso::

      * :ref:`chapter_ring` chapter

