.. _spruce_examples_add_receptor_to_du:

Add Receptor Grid to Design Unit
==================================

This example adds a receptor grid to the design unit. Providing the pred and mask arguments
allows the user to control which component of the design unit is going to be treated as the receptor.

.. seealso::
  * :ref:`OEMakeReceptor <OEDocking_OEMakeReceptor>` function

Example
--------------------------------------------------------------------------------

.. oe:language:: python

    .. code-block:: console

        prompt> add_receptor_obj_to_du.py -du <oedu> -out <output oedu> -mask <OEDesignUnitComponents> -pred <predicate string>

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`add_receptor_obj_to_du.py <../../../../wrappers/python/examples/spruce/add_receptor_obj_to_du.py>`

   .. :ref:`Full listing. <listing-add_receptor_obj_to_du.py>`

   ..  literalinclude:: ../../../../wrappers/python/examples/spruce/add_receptor_obj_to_du.py

   .. only:: oepdf

      .. oe:source:: add_receptor_obj_to_du.py
         :language: python