Site Setup
Create a wind farm
// Create Wind Farm
WindFarm myFarm = new WindFarm("My Farm");
// Set Wind Farm options
myFarm.IsNeighbour = false;
myFarm.ExcludeFromCalculation = false;
// Add farm to workbook
Workbook.WindFarms.Add(myFarm);
Load a TRBX file
// Create a turbine type from a trbx file. Requires full path
TurbineType turbineType = new TurbineType(
@"C:\TestData\Generic, 1.5 MW,
1.5 MW, Rot 70 m, H 80 m, Air 1.225, DB 97.1, PC Man-None.trbx");
// Add the turbine type to the workbook
Workbook.TurbineTypes.Add(turbineType);
Create a turbine
// Need an existing turbine type
TurbineType turbineType = Workbook.TurbineTypes["Generic Turbine 1.5MW"];
// Location of turbine
Location location = new Location(305000, 6674550);
// Create turbine
Turbine turbine = new Turbine(
"Turbine 1",
location,
turbineType);
// Add turbine to workbook. Turbine needs to be added to existing wind farm
Workbook.WindFarms["My Farm"].Turbines.Add(turbine);
Loading WOT file
// Loading a wot file using current workbook projection. Requires full path
Toolbox.ImportTurbines(
@"C:\TestData\turbines.wot",
Workbook.Geography.Projection);
Number of turbines in the workbook
// Find the number of turbines in the workbook
int numberOfTurbines = Workbook.Turbines.Count;
Hub height of a turbine
// I want the hub height of turbine with name "A1"
Turbine t = Workbook.Turbines["A1"];
double hubHeight = t.HubHeightLocation.HeightAboveGround;
Get the first turbine type
// Will return the first turbine type in the list or null if the list is empty.
TurbineType turbineType = Workbook.TurbineTypes.FirstOrDefault();