.. _example_generation: Generating Examples =================== The RTI *Code Generator* (also referred to as *rtiddsgen*) included with |me| can generate DDS example applications with a type definition file as input. .. note:: Before running *rtiddsgen*, you might need to add ``rti_connext_dds-/rtiddsgen/scripts`` to your path environment variable folder. Default example --------------- To generate an example, run the following command: .. code-block:: console rtiddsgen -example -language This generates an example using the default example template, which uses the Dynamic Participant Static Endpoint (DPSE) discovery plugin and UDP communication. *rtiddsgen* accepts the following options: - ``-example``: Generates type files, example files, and CMakelists files. - ``-language ``: Generates C code. The generated example can then be compiled using `CMake `_ and the ``CMakelists.txt`` file generated by *Code Generator*. *Code Generator* also creates a ``README.txt`` file with a description of the example and instructions for how to compile and run it. Custom example -------------- *Code Generator* can also generate examples using custom templates with the option ``-exampleTemplate ``. To generate an example using a custom template instead of the default one, run the following command: .. code-block:: console rtiddsgen -example -exampleTemplate