.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEWriteMDLFile

.. oe:function:: OEWriteMDLFile

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

      .. oe:api::

         void OEWriteMDLFile(oemolostream& ofs, OEMolBase& mol,
                             unsigned int flavor = OEOFlavor::MDL::DEFAULT)

   .. oe:language:: python

      .. oe:api:: python

         OEWriteMDLFile(ofs: oemolostream, mol: Union[OEGraphMol,OEMol,OEQMol],
                        flavor: int) -> None

   Writes the molecule as a MDL mol format file to the output stream
   'ofs'.  A number of different MDL format variants are
   supported by the use of the 'flavor' parameter from the
   :oe:constns:`OEChem::OEOFlavor::MDL` namespace.

   By default, only molecules with more than 999 atoms or enhanced
   stereo groups will be written in V3000 format. The
   :oe:const:`OEChem::OEOFlavor::MDL::MV30` flavor can be used to force
   all molecules to be written in the V3000 format.

