.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEGenerate2DCoordinates

.. oe:function:: OEGenerate2DCoordinates

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

      .. oe:api::

         bool OEGenerate2DCoordinates(OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OEGenerate2DCoordinates(mol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

   Assigns 2D coordinates to the given :ref:`OEMolBase <OEChem_OEMolBase>`
   object.
   The coordinates of each explicit atom are assigned using the
   :oe:meth:`OEChem::OEMolBase::SetCoords` method.
   This function automatically set the dimensionality of the molecule
   to two, using the :oe:meth:`OEChem::OEMolBase::SetDimension` method.

   .. note::

      :oe:func:`OEChem::OEGenerate2DCoordinates` is a low-level function
      that only generates 2D coordinates but does not perform any other
      perceptions.

      :oe:func:`OEChem::OEGenerate2DCoordinates` will clear MDL bond stereo
      information that can be re-perceived by calling the
      :oe:func:`OEChem::OEMDLPerceiveBondStereo` function.


   If :oe:func:`OEChem::OEGenerate2DCoordinates` fails to generate
   2D coordinates that correspond to the atom and bond stereo information
   of the molecule it returns ``false``.
   This problem occurs when no **built-in** ring template exists for a
   specific stereo configuration. To avoid this issue specifying user-defined
   ring template might be necessary.
   For more information see the :ref:`chapter_2D_coordinates` chapter.

   .. seealso::

      :oe:func:`OEChem::OEInit2DRingDictionary` function


.. ################################################################
   #
   ################################################################

