.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEInit2DRingDictionary

..  _oechem_oeinit2dringdictionary:

.. oe:function:: OEInit2DRingDictionary

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

      .. oe:api::

         bool OEInit2DRingDictionary(oemolistream& ims)
         bool OEInit2DRingDictionary(const std::string& filename)

   .. oe:language:: python

      .. oe:api:: python

         OEInit2DRingDictionary(ims: oemolistream) -> bool
         OEInit2DRingDictionary(filename: str) -> bool

   Initializes the **global** ring dictionary with the ring layouts stored
   in the given file.
   After initialization, the user-defined ring layouts will have priority over
   the built-in ring templates of **OEChem TK** when calling the
   :oe:func:`OEChem::OEGenerate2DCoordinates` function to generate 2D coordinates.

   .. seealso::

      * :ref:`OE2DRingDictionary <OEChem_OE2DRingDictionary>` class
      * :oe:func:`OEChem::OEIsValid2DRingDictionary` function
      * :oe:func:`OEChem::OEClear2DRingDictionary` function

      2D ring dictionary files can be generated with the following programs:

      .. oe:language:: c++

         * Example program :ref:`createringdict.cpp<section_example_oechem_createringdict>`
         * Example program :ref:`appendringdict.cpp<section_example_oechem_appendringdict>`

      .. oe:language:: python

         * Example program :ref:`createringdict.py<section_example_oechem_createringdict>`
         * Example program :ref:`appendringdict.py<section_example_oechem_appendringdict>`

      .. oe:language:: java

         * Example program :ref:`CreateRingDict.java<section_example_oechem_createringdict>`
         * Example program :ref:`AppendRingDict.java<section_example_oechem_appendringdict>`

      .. oe:language:: csharp

         * Example program :ref:`CreateRingDict.cs<section_example_oechem_createringdict>`
         * Example program :ref:`AppendRingDict.cs<section_example_oechem_appendringdict>`

      The program below shows how to generate 2D coordinates with user-defined
      ring layouts:

      .. oe:language:: c++

         * Example program :ref:`generate2D.cpp<section_example_oechem_generate2D>`

      .. oe:language:: python

         * Example program :ref:`generate2D.py<section_example_oechem_generate2D>`

      .. oe:language:: java

         * Example program :ref:`Generate2D.java<section_example_oechem_generate2D>`

      .. oe:language:: csharp

         * Example program :ref:`Generate2D.cs<section_example_oechem_generate2D>`


