.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OESetMDLDimensionFromCoords

..  _oechem_oesetmdldimensionfromcoords:

.. oe:function:: OESetMDLDimensionFromCoords

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

      .. oe:api::

         void OESetMDLDimensionFromCoords(OEMolBase &)

   .. oe:language:: python

      .. oe:api:: python

         OESetMDLDimensionFromCoords(arg1: Union[OEGraphMol,OEMol,OEQMol]) -> None

   Assigns the molecule's dimension property from the coordinates using the :oe:meth:`OEChem::OEMolBase::SetDimension` method.
   The dimension property is set to the value:
   
   * ``0`` if all x, y, z coordinates are zero
   * ``2`` if there is at least one atom with non-zero x or z coordinates
   * ``3`` it there is at least one atom with non-zero z coordinate


   The table below illustrates the difference between the :oe:func:`OEChem::OESetDimensionFromCoords` and
   :oe:func:`OEChem::OESetMDLDimensionFromCoords` functions.

   +--------------------------+--------------------------+------------------------------+
   | Coordinates              | OESetDimensionFromCoords | OESetMDLDimensionFromCoords  |
   +--------+--------+--------+                          +                              +
   |  X     |  Y     |  Z     |                          |                              |
   +========+========+========+==========================+==============================+
   |  0.00  |  0.00  |  0.00  |  0D                      |  0D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  1.00  |  0.00  |  0.00  |  1D                      |  2D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  0.00  |  1.00  |  0.00  |  1D                      |  2D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  0.00  |  0.00  |  1.00  |  1D                      |  3D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  1.00  |  1.00  |  0.00  |  2D                      |  2D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  0.00  |  1.00  |  1.00  |  2D                      |  3D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  1.00  |  0.00  |  1.00  |  2D                      |  3D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  1.00  |  1.00  |  1.00  |  3D                      |  3D                          |
   +--------+--------+--------+--------------------------+------------------------------+

   .. seealso::

      * :oe:func:`OEChem::OEGetMDLDimensionFromCoords` function
      * :oe:func:`OEChem::OEGetDimensionFromCoords` and :oe:func:`OEChem::OESetDimensionFromCoords` functions


