.. _section_examples_summary_applychargesoedu:

Applying Charges to OEDesignUnit
=========================================================

The following code example shows how to apply charges to an OEDesignUnit.
The program reads an OEDesignUnit as the input file, applies charges
to it, and writes new OEDesignUnit to the specified output file.


Command Line Interface
----------------------

A description of the command line interface is as follows.


.. oe:language:: c++

   .. code-block:: console

      prompt> applycharges_oedu [<oedu infile>] [<oedu outfile>]

.. oe:language:: python

   .. code-block:: console

      prompt> python applycharges_oedu.py [<oedu infile>] [<oedu outfile>]



Code
--------------------------------------------------------------------------------

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`applycharges_oedu.py <../../../../wrappers/python/examples/quacpac/applycharges_oedu.py>`

      .. literalinclude:: ../../../../wrappers/python/examples/quacpac/applycharges_oedu.py

   .. only:: oepdf

      .. oe:source:: applycharges_oedu.py
         :language: python


.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`applycharges_oedu.cpp <../../../../sublibs/tklibs/quacpac/examples/applycharges_oedu.cpp>`

   .. only:: oepdf

      .. oe:source:: applycharges_oedu.cpp
         :language: c++


.. seealso::

   * :ref:`OEDesignUnitCharges <OEProton_OEDesignUnitCharges>` class
   * :ref:`OEDesignUnit <OEBio_OEDesignUnit>` class

