How can I insert mast / tower representations with individual properties in the geographic diagram?

Category:
Scripting
Answer

For grid planning and operating purposes, there are some non-calculation-relevant reasons to model the masts / towers with their exact position and some additional properties in a geographic diagram. With the Python-script that is stored in the attached project, it is possible to import masts from table data to a geographic diagram in PowerFactory. The created objects are only intended for graphical representation and will not influence the calculations as they are not connected to the grid and out of service.

As example, an Excel table is attached as well that can be imported in with the example project. The script needs the path to the .xlsx-file as input parameter and will do the following on execution:

  1. Create a new grid (ElmNet) in which the new mast objects are stored.
  2. Loading the table data using pandas (this additional Python-plugin is needed).
  3. For all additional parameters besides “loc_name”, “GPSlon“ and “GPSlat”  that are given in the table, a data extension for the terminal object (ElmTerm) is created in the project. The additional columns are user-definable and can be changed as needed.
  4. New mast objects are created in the project (the object ElmTerm with the setting “out of service” is used for that) and a graphical symbol for them is shown in the Geographic diagram that is selected as “External object” on the Basic Options page of the script. The symbol that is used for this can be defined with the parameter “symbol” in the Input parameters of the script.
  5. A separate layer for the new objects is created to make it easier to toggle their visibility.
Back