.. _objects_wtg: WTG Object Service ================== The ObjWtgService is giving access to wind turbine generator objects. To make a new wtg object, you can use the ObjectService. Then getting the properties of the wtg with the ``ObjWtgService.GetWtgObject``. These properties can be manipulated and then send back to windPRO with ``ObjWtgService.SetWtgObject``. Adding a path with a wtg file is enough to do a basic calculation. More advanced manipulation is not possible at the moment. Properties of the object can be found here :ref:`TApiObjWtg `. It is possible to change the power and noise curves that are used in a turbine. Each curve is identified by a unique ID. To get access to those you need to open the wtg file with :ref:`services_wtgExplorerService`. You can do that with ``WtgExplorerService.GetWtgFromFile(filename=file_name, details=True)`` displaying all information that is stored inside the wtg (though not the actual power curve values). You need to assign the right UID to identify the choice of power curve, noise data etc. .. list-table:: Which value to modify to choose power curve, noise data etc. :widths: 40 40 :header-rows: 1 * - UniqueID WtgExplorerService - Where to assign in TApiObjWtg * - WTGDTPowerCurve - Powercurve * - WTGDTNoise - Noisedata * - WTGDTVisual - Noisedata * - WTGDTeGrid - Noisedata * - WTGDTAny - * - WTGDTPCNoiseList - PCNoise * - WTGDTPowerMatrix - PowerMatrix * - WTGDTVisual3D - Additionally, you need to set the boolean flags correctly to correctly set the power or noise curves. * For any choice that is not using default power curves use: ``UseDefault = False``. * For using classical powre curves use: ``LegacyMode = True`` and ``PowerMatrixMode = False``. * For power noice pairs format use: ``LegacyMode = False`` and ``PowerMatrixMode = False``. * For Powermatrix format use: ``LegacyMode = False`` and ``PowerMatrixMode = True``. Find below a working example that can be run on the test project New Salem. .. literalinclude:: ../../../python/examples/fromDocs/objects/wtg_object.py