Class Toolbox
Static helper methods for scripting.
Namespace: Scripting
Syntax
public static class Toolbox
Properties
CurrentWorkbookPath
Gets the current workbook path
Declaration
public static string CurrentWorkbookPath { get; }
Property Value
Type | Description |
---|---|
System.String |
MeasurementCampaign
Gets the measurement campaign toolbox
Declaration
public static MeasurementCampaignToolbox MeasurementCampaign { get; }
Property Value
Type | Description |
---|---|
MeasurementCampaignToolbox |
Noise
Gets the noise functionality.
Declaration
public static NoiseToolbox Noise { get; }
Property Value
Type | Description |
---|---|
NoiseToolbox |
Optimisation
Gets the optimisation toolbox functionality.
Declaration
public static OptimisationToolbox Optimisation { get; }
Property Value
Type | Description |
---|---|
OptimisationToolbox |
ShadowFlicker
Gets the shadow flicker functionality.
Declaration
public static ShadowFlickerToolbox ShadowFlicker { get; }
Property Value
Type | Description |
---|---|
ShadowFlickerToolbox |
Methods
ActivateLayoutScenario(LayoutScenario)
Activates the supplied layout scenario.
Declaration
public static void ActivateLayoutScenario(LayoutScenario layoutScenario)
Parameters
Type | Name | Description |
---|---|---|
LayoutScenario | layoutScenario | The layout scenario to activate. |
AddContours(ElevationGrid, Double, Boolean)
Convert the elevation grid to contours and add to the workbook. Throws a ScriptingException if conversion fails.
Declaration
public static void AddContours(ElevationGrid grid, double spacingInMetres, bool disableSmoothing)
Parameters
Type | Name | Description |
---|---|---|
ElevationGrid | grid | The elevation grid to convert |
System.Double | spacingInMetres | The spacing in metres |
System.Boolean | disableSmoothing | Whether to disable smoothing on contour generation |
AddEfficiencyCategory(String)
Adds existing efficiency category
Declaration
public static void AddEfficiencyCategory(string categoryToAdd)
Parameters
Type | Name | Description |
---|---|---|
System.String | categoryToAdd | The category name to add |
AddElevationGrid(ElevationContours, Double)
Convert the contours to a grid and add it to the workbook. Throws a ScriptingException if conversion fails.
Declaration
public static void AddElevationGrid(ElevationContours contours, double resolution)
Parameters
Type | Name | Description |
---|---|---|
ElevationContours | contours | The contours to convert |
System.Double | resolution | The resolution to generate the grid at. |
AddUncertaintyCategory(String)
Adds existing uncertainty category
Declaration
public static void AddUncertaintyCategory(string categoryToAdd)
Parameters
Type | Name | Description |
---|---|---|
System.String | categoryToAdd | The category name to add |
AutoGenerateInitiationRegions()
Auto generate initiation regions based on loaded discrete wind resource locations and the mast they belong to.
Declaration
public static void AutoGenerateInitiationRegions()
CalculateBaseRoughness()
Computes base and increased roughness and stores them in LWF model settings
Declaration
public static double CalculateBaseRoughness()
Returns
Type | Description |
---|---|
System.Double |
CalculateEnergy()
Runs the energy calculation.
Declaration
public static Scenario CalculateEnergy()
Returns
Type | Description |
---|---|
Scenario | A scenario |
CalculateFlowCase(Scenario, DateTime, MeasurementSite, Double, PointLocationFlowCase, IAirDensity, Boolean)
Calculate a flow case
Declaration
public static Scenario CalculateFlowCase(Scenario input, DateTime time, MeasurementSite referenceMeasurementSite, double referenceHeightAboveGround, PointLocationFlowCase referenceLocationFlowCase, IAirDensity airDensity, bool useSimpsonsIntegration = true)
Parameters
Type | Name | Description |
---|---|---|
Scenario | input | The Scenario for input and storing results (if null a new one is created from the current workbook) |
System.DateTime | time | The time stamp for the flow case |
MeasurementSite | referenceMeasurementSite | The reference measurement site. |
System.Double | referenceHeightAboveGround | The reference height. |
PointLocationFlowCase | referenceLocationFlowCase | The flow case at the reference location |
IAirDensity | airDensity | The air density at the reference location |
System.Boolean | useSimpsonsIntegration | Whether to use simpsons integration or the analytical wind profile integration. |
Returns
Type | Description |
---|---|
Scenario | The scenario with a new flow case added, keyed by the time stamp |
Exceptions
Type | Condition |
---|---|
ScriptingException | Thrown if the calculation fails |
CalculateFlowCase(Scenario, DateTime, MeasurementSite, Double, PointLocationFlowCase, IAirDensity, Dictionary<Turbine, Double>, Dictionary<Turbine, Double>, TurbinePerformanceProviderBase, Boolean)
Calculate a flow case
Declaration
public static Scenario CalculateFlowCase(Scenario input, DateTime time, MeasurementSite referenceMeasurementSite, double referenceHeightAboveGround, PointLocationFlowCase referenceLocationFlowCase, IAirDensity airDensity, Dictionary<Turbine, double> yawOffsetPerTurbines, Dictionary<Turbine, double> deltaSetPointsPerTurbines, TurbinePerformanceProviderBase turbinePerformanceProvider, bool useSimpsonsIntegration = true)
Parameters
Type | Name | Description |
---|---|---|
Scenario | input | The Scenario for input and storing results (if null a new one is created from the current workbook) |
System.DateTime | time | The time stamp for the flow case |
MeasurementSite | referenceMeasurementSite | The reference measurement site. |
System.Double | referenceHeightAboveGround | The reference height. |
PointLocationFlowCase | referenceLocationFlowCase | The flow case at the reference location |
IAirDensity | airDensity | The air density at the reference location |
System.Collections.Generic.Dictionary<Turbine, System.Double> | yawOffsetPerTurbines | Dictionary of yaw offset in degrees per turbine. If turbine is not present then 0 degrees is used. |
System.Collections.Generic.Dictionary<Turbine, System.Double> | deltaSetPointsPerTurbines | Dictionary of delta set points in kW per turbine. If turbine is not present then 0 kW is used. |
TurbinePerformanceProviderBase | turbinePerformanceProvider | A turbine performance provider. For example from a loads database file. |
System.Boolean | useSimpsonsIntegration | Whether to use simpsons integration or the analytical wind profile integration. |
Returns
Type | Description |
---|---|
Scenario | The scenario with a new flow case added, keyed by the time stamp |
Exceptions
Type | Condition |
---|---|
ScriptingException | Thrown if the calculation fails |
CalculateFlowCases(Scenario, MeasurementSite, Double, IList<DateTime>, IList<PointLocationFlowCase>, IList<IAirDensity>, Boolean)
Calculate flow cases
Declaration
public static Scenario CalculateFlowCases(Scenario input, MeasurementSite referenceMeasurementSite, double referenceHeightAboveGround, IList<DateTime> times, IList<PointLocationFlowCase> referenceLocationFlowCases, IList<IAirDensity> airDensities, bool useSimpsonsIntegration = true)
Parameters
Type | Name | Description |
---|---|---|
Scenario | input | The Scenario for input and storing results (if null a new one is created from the current workbook) |
MeasurementSite | referenceMeasurementSite | The reference measurement site. |
System.Double | referenceHeightAboveGround | The reference height. |
System.Collections.Generic.IList<System.DateTime> | times | The time stamps for the flow case |
System.Collections.Generic.IList<PointLocationFlowCase> | referenceLocationFlowCases | The flow cases at the reference location |
System.Collections.Generic.IList<IAirDensity> | airDensities | The air densities at the reference location |
System.Boolean | useSimpsonsIntegration | Whether to use simpsons integration or the analytical wind profile integration. |
Returns
Type | Description |
---|---|
Scenario | The scenario with a new flow cases added, keyed by the time stamps |
Exceptions
Type | Condition |
---|---|
ScriptingException | Thrown if the calculation fails |
CalculateFlowCases(Scenario, MeasurementSite, Double, IList<DateTime>, IList<PointLocationFlowCase>, IList<IAirDensity>, Dictionary<Turbine, Double>, Dictionary<Turbine, Double>, TurbinePerformanceProviderBase, Boolean)
Calculate flow cases
Declaration
public static Scenario CalculateFlowCases(Scenario input, MeasurementSite referenceMeasurementSite, double referenceHeightAboveGround, IList<DateTime> times, IList<PointLocationFlowCase> referenceLocationFlowCases, IList<IAirDensity> airDensities, Dictionary<Turbine, double> yawOffsetPerTurbines, Dictionary<Turbine, double> deltaSetPointsPerTurbines, TurbinePerformanceProviderBase turbinePerformanceProvider, bool useSimpsonsIntegration = true)
Parameters
Type | Name | Description |
---|---|---|
Scenario | input | The Scenario for input and storing results (if null a new one is created from the current workbook) |
MeasurementSite | referenceMeasurementSite | The reference measurement site. |
System.Double | referenceHeightAboveGround | The reference height. |
System.Collections.Generic.IList<System.DateTime> | times | The time stamps for the flow case |
System.Collections.Generic.IList<PointLocationFlowCase> | referenceLocationFlowCases | The flow cases at the reference location |
System.Collections.Generic.IList<IAirDensity> | airDensities | The air densities at the reference location |
System.Collections.Generic.Dictionary<Turbine, System.Double> | yawOffsetPerTurbines | Dictionary of yaw offset in degrees per turbine. If turbine is not present then 0 degrees is used. |
System.Collections.Generic.Dictionary<Turbine, System.Double> | deltaSetPointsPerTurbines | Dictionary of delta set points in kW per turbine. If turbine is not present then 0 kW is used. |
TurbinePerformanceProviderBase | turbinePerformanceProvider | A turbine performance provider. For example from a loads database file. |
System.Boolean | useSimpsonsIntegration | Whether to use simpsons integration or the analytical wind profile integration. |
Returns
Type | Description |
---|---|
Scenario | The scenario with a new flow cases added, keyed by the time stamps |
Exceptions
Type | Condition |
---|---|
ScriptingException | Thrown if the calculation fails |
CalculateForestryDisplacementHeights()
Calculate forestry displacement heights for all masts and turbines
Declaration
public static void CalculateForestryDisplacementHeights()
CalculateNoise()
Runs the noise calculation.
Declaration
public static void CalculateNoise()
CalculatePowerTimeSeries()
Runs the power time series calculation.
Declaration
public static void CalculatePowerTimeSeries()
CalculateWindFlow()
Calculates wind flow.
Declaration
public static void CalculateWindFlow()
CalculateWindFlowCalibration()
Calculates the wind flow calibration factor to fit flow to installed turbine yields
Declaration
public static void CalculateWindFlowCalibration()
CloneLayoutScenario(LayoutScenario, String, Boolean)
Clones and optionally activates a layout design scenario.
Declaration
public static void CloneLayoutScenario(LayoutScenario layoutScenario, string newName, bool shouldActivate = false)
Parameters
Type | Name | Description |
---|---|---|
LayoutScenario | layoutScenario | The layout scenario. |
System.String | newName | The name for the new scenario. |
System.Boolean | shouldActivate | Whether the cloned scenario should be auto activated or not. |
CreateNewLayoutScenario(String, Boolean)
Creates a new empty layout scenario.
Declaration
public static void CreateNewLayoutScenario(string newName, bool shouldActivate = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | newName | The name for the new scenario. |
System.Boolean | shouldActivate | Whether the scenario should be activated or not. |
CreateTurbinePerformanceProviderFromFile(String)
Creates a turbine performance provider from a Loads database file.
Declaration
public static TurbinePerformanceProviderBase CreateTurbinePerformanceProviderFromFile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to the file. |
Returns
Type | Description |
---|---|
TurbinePerformanceProviderBase | A turbine performance provider from a Loads database file. |
DeleteForestryGrid(ForestryGrid)
Deletes a forestry grid.
Declaration
public static void DeleteForestryGrid(ForestryGrid forestryGrid)
Parameters
Type | Name | Description |
---|---|---|
ForestryGrid | forestryGrid | The forestry grid to delete. |
DeleteForestryVectors(ForestryVectors)
Deletes forestry vectors.
Declaration
public static void DeleteForestryVectors(ForestryVectors forestryVectors)
Parameters
Type | Name | Description |
---|---|---|
ForestryVectors | forestryVectors | The forestry vectors to delete. |
DeleteLayoutScenario(LayoutScenario)
Delete a layout scenario.
Declaration
public static void DeleteLayoutScenario(LayoutScenario layoutScenario)
Parameters
Type | Name | Description |
---|---|---|
LayoutScenario | layoutScenario | The layout scenario to delete. |
ExportBaseRoughnessReport(String)
Writes to filePath
averaged base and increased roughness as well as sector roughness and sector probability per turbine and wind climate
Declaration
public static void ExportBaseRoughnessReport(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | Path of output text file |
ExportCurtailmentsToFile(String)
Exports all curtailments and curtailment types to file.
Declaration
public static void ExportCurtailmentsToFile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path to output to. |
ExportElevationContours(String, ElevationContours, Boolean)
Exports elevation contours from the workbook.
Declaration
public static void ExportElevationContours(string filePath, ElevationContours contours, bool overwriteOnExport = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path to export to. |
ElevationContours | contours | The contours to export. |
System.Boolean | overwriteOnExport | Whether to overwrite on export or fail. |
ExportEpaReport(String)
Export the EPA report to the specified filePath
Declaration
public static void ExportEpaReport(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file to output to. |
ExportFlowCalibrationJson(String)
Export flow calibration inputs json
Declaration
public static void ExportFlowCalibrationJson(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath |
ExportMapImage(String, Int32, Int32)
Exports the map image.
Declaration
public static void ExportMapImage(string mapImageFilePath, int mapWidthInPixels, int mapHeightInPixels)
Parameters
Type | Name | Description |
---|---|---|
System.String | mapImageFilePath | The map image file path. |
System.Int32 | mapWidthInPixels | The map width in pixels. |
System.Int32 | mapHeightInPixels | The map height in pixels. |
ExportNoiseCalculationJson(String)
Exports the noise calculation inputs json. The inputs are extracted from the workbook.
Declaration
public static void ExportNoiseCalculationJson(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path to export to. |
ExportNoiseResultsToFile(String)
Exports the noise results to file.
Declaration
public static void ExportNoiseResultsToFile(string directoryPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | directoryPath | The directory path. |
ExportPowerTimeSeriesJson(String)
Export a power time series inputs json. The inputs will be matched and only coincident cases exported.
Declaration
public static void ExportPowerTimeSeriesJson(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path for the json file |
ExportResultsTsvFiles(String)
Exports the results TSV files
Declaration
public static void ExportResultsTsvFiles(string folderPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderPath |
ExportSingleFlowCasePowerJson(DateTime, PointLocationFlowCase, IAirDensity, Double, Double, Double, String)
Exports the a single flow case JSON from the workbook
Declaration
public static void ExportSingleFlowCasePowerJson(DateTime time, PointLocationFlowCase referenceLocationFlowCase, IAirDensity airDensity, double temperature, double temperatureLapseRate, double temperatureElevation, string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | time | The date and time |
PointLocationFlowCase | referenceLocationFlowCase | The flow case at the reference location |
IAirDensity | airDensity | The air density at the reference location |
System.Double | temperature | The flow case temperature. |
System.Double | temperatureLapseRate | The flow case temperature lapse rate. |
System.Double | temperatureElevation | The total elevation at which the temperature is defined. |
System.String | filePath | the file path to export the json |
ExportWindFarmerEnergyJson(String)
Exports the windFarmer energy JSON from the workbook. When using the association method energy will be evaluated up to the highest non-zero bin of the frequency distributions. When using the non-association method energy will be evaluated to the UI defined maximum wind speed for testing.
Declaration
public static bool ExportWindFarmerEnergyJson(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path to export. |
Returns
Type | Description |
---|---|
System.Boolean | True on success, otherwise false is returned. |
ExportWorkbookResultsJson(String)
Exports a .json file with an hierarchical data model of every report-related property in the Workbook
Declaration
public static void ExportWorkbookResultsJson(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The full path of the resulting json report file |
Exceptions
Type | Condition |
---|---|
ScriptingException |
GenerateClosePackedLayout(WindFarm, TurbineType, Int32, I2DLocation, Boolean)
Generates a close packed layout of turbines.
Declaration
public static void GenerateClosePackedLayout(WindFarm windFarm, TurbineType turbineType, int maxNumberOfTurbines, I2DLocation location, bool respectBuildableAreas = true)
Parameters
Type | Name | Description |
---|---|---|
WindFarm | windFarm | The wind farm to add the turbines too. |
TurbineType | turbineType | The turbine type of the turbines being added. |
System.Int32 | maxNumberOfTurbines | The maximum number of turbines to try and add. |
I2DLocation | location | The starting location. |
System.Boolean | respectBuildableAreas | Whether to respect buildable areas or not. |
Exceptions
Type | Condition |
---|---|
ScriptingException |
GetElevation(IReadable2DLocation)
Get the elevation at the specified location
Declaration
public static Elevation GetElevation(IReadable2DLocation location)
Parameters
Type | Name | Description |
---|---|---|
IReadable2DLocation | location | The location |
Returns
Type | Description |
---|---|
Elevation | The elevation at that location |
GetElevationProfileStatistics(IReadable2DLocation, IReadable2DLocation)
Gets the elevation profile statistics (in the workbook coordinates projection).
Declaration
public static ElevationProfileStatistics GetElevationProfileStatistics(IReadable2DLocation startPoint, IReadable2DLocation endPoint)
Parameters
Type | Name | Description |
---|---|---|
IReadable2DLocation | startPoint | The start point (in workbook coordinates). |
IReadable2DLocation | endPoint | The end point (in workbook coordinates). |
Returns
Type | Description |
---|---|
ElevationProfileStatistics | An ElevationProfileStatistics objects for the elevation profile along the line. |
GetElevationProfileStatisticsForLatLonPoints(IReadable2DLocation, IReadable2DLocation, Double)
Gets the elevation profile statistics for the specified points (in latitude/longitude format)
Declaration
public static ElevationProfileStatistics GetElevationProfileStatisticsForLatLonPoints(IReadable2DLocation startPointInLatLon, IReadable2DLocation endPointInLatLon, double maxSlopeThatIsConsideredFlat = 0)
Parameters
Type | Name | Description |
---|---|---|
IReadable2DLocation | startPointInLatLon | The start point (in lat lon). |
IReadable2DLocation | endPointInLatLon | The end point (in lat lon). |
System.Double | maxSlopeThatIsConsideredFlat | The maximum absolute slope value that is considered flat (defaults to 0.0). |
Returns
Type | Description |
---|---|
ElevationProfileStatistics | An ElevationProfileStatistics objects for the elevation profile along the line. |
GetForestryHeight(IReadable2DLocation)
Get the forestry height at the specified location
Declaration
public static Elevation GetForestryHeight(IReadable2DLocation location)
Parameters
Type | Name | Description |
---|---|---|
IReadable2DLocation | location | The location |
Returns
Type | Description |
---|---|
Elevation | The forestry height at that location |
GetNoiseOrDefault(Point, Double)
Gets the noise value by location.
Declaration
public static double GetNoiseOrDefault(Point point, double defaultValue = 9999)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The point. |
System.Double | defaultValue | The default value. |
Returns
Type | Description |
---|---|
System.Double | The noise value by location. |
GetNoiseOrDefault(I2DLocation, Double)
Gets the noise value by location.
Declaration
public static double GetNoiseOrDefault(I2DLocation location, double defaultValue = 9999)
Parameters
Type | Name | Description |
---|---|---|
I2DLocation | location | The location. |
System.Double | defaultValue | The default value. |
Returns
Type | Description |
---|---|
System.Double | The noise value by location. |
GetPointWindResourceForLocation(WindClimate, IReadable3DLocation)
Gets the point wind resource for a provided location.
Declaration
public static PointWindResource GetPointWindResourceForLocation(WindClimate windClimate, IReadable3DLocation location)
Parameters
Type | Name | Description |
---|---|---|
WindClimate | windClimate | The wind climate to interrogate. |
IReadable3DLocation | location | The requested location. |
Returns
Type | Description |
---|---|
PointWindResource | The point wind resource or null on error. |
GetProjectionFromEpsgCode(UInt32)
Get a Projection from the epsg code
Declaration
public static Projection GetProjectionFromEpsgCode(uint epsgCode)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | epsgCode | The epsg code |
Returns
Type | Description |
---|---|
Projection | A Projection for the specified code, or null |
GetProjectionInformation(Projection)
Gets some projection information from a provided projection.
Declaration
public static ProjectionInformation GetProjectionInformation(Projection projection)
Parameters
Type | Name | Description |
---|---|---|
Projection | projection | The projection to acquire information from. |
Returns
Type | Description |
---|---|
ProjectionInformation | The projection information. |
ImportAdjustmentRegionFromShapeFile(String, Double)
Imports an adjustment region from a shape file.
Declaration
public static void ImportAdjustmentRegionFromShapeFile(string filePath, double adjustment)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path. |
System.Double | adjustment | The wind speed adjustment. |
ImportBackgroundImage(String, Projection)
Import a Background Image from the specified file into the workbook. Uses the projection specified as a parameter for the file, throws if the file has projection information that does not match the specified projection. Throws if the Workbook does not have a projection. Throws if the file does not exist, or is not an appropriate Elevation Grid file.
Declaration
public static void ImportBackgroundImage(string filePath, Projection projection = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | |
Projection | projection | The projection of the grid in the file. |
ImportCurtailmentsFromFile(String, Boolean)
Import curtailments and curtailment types from file.
Declaration
public static void ImportCurtailmentsFromFile(string filePath, bool removeExistingCurtailments = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path to output to. |
System.Boolean | removeExistingCurtailments | Whether all curtailments on a scenario should be removed on import. |
ImportDiscreteWindResource(String, WindClimate)
Import a discrete wind resource and add it to the mast
Declaration
public static void ImportDiscreteWindResource(string discreteWindResourcePath, WindClimate windClimate)
Parameters
Type | Name | Description |
---|---|---|
System.String | discreteWindResourcePath | The path to the discrete wind resource file |
WindClimate | windClimate | The mast to add the wind resource to if it is loaded |
ImportElevationContours(String, Projection)
Import elevation contours from the specified file into the workbook. Assumes the file has appropriate projection information. Throws if the Workbook does not have a projection. Throws if the file does not have any projection information. Throws if the file does not exist, or is not an appropriate contour data file.
Declaration
public static void ImportElevationContours(string filePath, Projection projection = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The full file path of the elevation contours file to import. |
Projection | projection | The projection of the grid in the file. |
ImportElevationGrid(String, Projection)
Import an Elevation Grid from the specified file into the workbook. Uses the projection specified as a parameter for the file, throws if the file has projection information that does not match the specified projection. Throws if the Workbook does not have a projection. Throws if the file does not exist, or is not an appropriate Elevation Grid file.
Declaration
public static void ImportElevationGrid(string filePath, Projection projection = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The full file path of the elevation grid |
Projection | projection | The projection of the grid in the file. |
ImportExclusionRegionFromShapefile(String)
Imports an inclusion region from shapefile.
Declaration
public static void ImportExclusionRegionFromShapefile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path. |
Exceptions
Type | Condition |
---|---|
ScriptingException |
ImportForestryGrid(String, Projection)
Import an forestry Grid from the specified file into the workbook. Uses the projection specified as a parameter for the file, throws if the file has projection information that does not match the specified projection. Throws if the Workbook does not have a projection. Throws if the file does not exist, or is not an appropriate forestry Grid file.
Declaration
public static void ImportForestryGrid(string filePath, Projection projection = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The full file path of the forestry grid |
Projection | projection | The projection of the grid in the file. |
ImportGridWindResource(String, WindClimate)
Import a grid wind resource and add it to the mast
Declaration
public static void ImportGridWindResource(string gridWindResourcePath, WindClimate windClimate)
Parameters
Type | Name | Description |
---|---|---|
System.String | gridWindResourcePath | The path to the grid wind resource file |
WindClimate | windClimate | The windClimate to add the wind resource to if it is loaded |
ImportInclusionRegionFromShapefile(String)
Imports an inclusion region from shapefile.
Declaration
public static void ImportInclusionRegionFromShapefile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path. |
Exceptions
Type | Condition |
---|---|
ScriptingException |
ImportInitiationRegionFromShapeFile(String)
Imports an initiation region from a shape file.
Declaration
public static void ImportInitiationRegionFromShapeFile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path. |
Exceptions
Type | Condition |
---|---|
ScriptingException |
ImportLocationsFromShapeFile(String)
Imports locations from a shape file.
Declaration
public static Location[] ImportLocationsFromShapeFile(string shapeFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | shapeFilePath | The path to the shape file. |
Returns
Type | Description |
---|---|
Location[] | The imported locations from the shape file. |
ImportPointWindResource(String, WindClimate)
Import a point wind resource and add it to a mast
Declaration
public static void ImportPointWindResource(string fileName, WindClimate windClimate)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file with point resource data |
WindClimate | windClimate | The windClimate to add the point resource to |
ImportReceptorsFromFile()
Imports receptors from file.
Declaration
public static void ImportReceptorsFromFile()
ImportRoughnessContours(String, Projection)
Import roughness contours from the specified file into the workbook. Uses the projection specified as a parameter for the file, throws if the file has projection information that does not match the specified projection. Throws if the Workbook does not have a projection. Throws if the file does not exist, or is not an appropriate roughness data file.
Declaration
public static void ImportRoughnessContours(string filePath, Projection projection = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | |
Projection | projection | The projection of the grid in the file. |
ImportTurbines(String, Projection)
Import turbines from the specified file into the workbook. Uses the projection specified as a parameter for the file, throws if the file has projection information that does not match the specified projection. Throws if the Workbook does not have a projection. Throws if the file does not exist, or is not an appropriate turbines data file.
Declaration
public static void ImportTurbines(string filePath, Projection projection = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | |
Projection | projection | The projection of the grid in the file. |
ImportWindAnalysis(String)
Imports wind analysis data from sourceWorkbookPath
Declaration
public static void ImportWindAnalysis(string sourceWorkbookPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceWorkbookPath | Path of the source workbook |
ImportWindFarm(String, String)
Import wind farm from the specified workbook into the current workbook. Throws if the file has projection information that does not match the specified projection. Throws if the Workbook does not have a projection. Throws if the file does not exist, or is not an appropriate turbines data file. Throws if the wind farm name does not exist in the donor project.
Declaration
public static WindFarm ImportWindFarm(string filePath, string windFarmNameToImport)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to a Windfarmer workbook. |
System.String | windFarmNameToImport | The name of the wind farm to import. |
Returns
Type | Description |
---|---|
WindFarm | The newly added WindFarm after the import has completed. |
ImportWindResourceBackCalculatingReference(String)
Import a wind resource and generate a FD and reference resource from it (if required).
Declaration
public static void ImportWindResourceBackCalculatingReference(string windResourcePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | windResourcePath | The path to the grid wind resource file |
IsWaspAvailable(WAsPVersion)
Check if WAsP is available
Declaration
public static WAsPStatus IsWaspAvailable(WAsPVersion version)
Parameters
Type | Name | Description |
---|---|---|
WAsPVersion | version | The version of WAsP to check availability of. |
Returns
Type | Description |
---|---|
WAsPStatus | The status for the requested version of WAsP |
LoadProjectionFromFile(String)
Loads a prj file and returns a Projection object. Throws a ScriptingException if the file does not exist.
Declaration
public static Projection LoadProjectionFromFile(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | The projection file full path |
Returns
Type | Description |
---|---|
Projection | A Projection object, or null |
Log(String, LogLevel)
Prints a message to the log at a supplied log level.
Declaration
public static void Log(string message, LogLevel level = LogLevel.Info)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to print. |
LogLevel | level | The log level to output the message at. |
NewWorkbook()
Opens a new empty workbook (assumes discard already open workbook if not saved).
Declaration
public static void NewWorkbook()
OpenWorkbook(String)
Opens a workbook (assumes discard already open workbook if not saved).
Declaration
public static void OpenWorkbook(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path of the workbook to open. |
ReadRangeFromExcel(String, String, String)
Reads a range from Excel.
Declaration
public static IEnumerable<string> ReadRangeFromExcel(string filePath, string workSheetName, string rangeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to the excel workbook. |
System.String | workSheetName | The worksheet name. |
System.String | rangeName | The range name, or cell range address |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The content of the range as strings. |
RecalculateWindFlowCalibration()
recalculates the wind flow calibration statistics for the current wind flow calibration.
Declaration
public static void RecalculateWindFlowCalibration()
RedefineSiteLocation(Location)
Redefine the site location.
Declaration
public static void RedefineSiteLocation(Location siteLocation)
Parameters
Type | Name | Description |
---|---|---|
Location | siteLocation | The new site location where Location.X is longitude and Location.Y is latitude. |
RedefineWorkbookProjection(Projection)
Redefine the workbook projection
Declaration
public static void RedefineWorkbookProjection(Projection newWorkbookProjection)
Parameters
Type | Name | Description |
---|---|---|
Projection | newWorkbookProjection | The new workbook projection |
RemoveEfficiencyCategory(String)
Removes existing efficiency category
Declaration
public static void RemoveEfficiencyCategory(string categoryToRemove)
Parameters
Type | Name | Description |
---|---|---|
System.String | categoryToRemove | The category name to remove |
RemoveUncertaintyCategory(String)
Removes existing uncertainty category
Declaration
public static void RemoveUncertaintyCategory(string categoryToRemove)
Parameters
Type | Name | Description |
---|---|---|
System.String | categoryToRemove | The category name to remove |
ReprojectPoint(IReadable2DLocation, Projection, Projection)
Reproject a point
Declaration
public static I2DLocation ReprojectPoint(IReadable2DLocation location, Projection inProjection, Projection outProjection)
Parameters
Type | Name | Description |
---|---|---|
IReadable2DLocation | location | The point/location to reproject |
Projection | inProjection | The projection of the point |
Projection | outProjection | The projection to reproject into |
Returns
Type | Description |
---|---|
I2DLocation | A reprojected point, or throws a ScriptingException if reprojection is not possible |
RunExcelSubroutine(String, String, String)
Runs a subroutine in an Excel worksheet.
Declaration
public static void RunExcelSubroutine(string filePath, string workSheetName, string subroutineName)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to the excel workbook. |
System.String | workSheetName | The worksheet name. |
System.String | subroutineName | The name of the subroutine to run (must be public). |
RunMonteCarloEnergyAnalysis()
Simulates the net energy distribution.
Declaration
public static Scenario RunMonteCarloEnergyAnalysis()
Returns
Type | Description |
---|---|
Scenario | The scenario |
Save()
Saves a workbook.
Declaration
public static void Save()
Exceptions
Type | Condition |
---|---|
ScriptingException | Unable to save workbook. |
SaveAs(String)
Saves a workbook to the specified file path.
Declaration
public static void SaveAs(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path to save to. |
Exceptions
Type | Condition |
---|---|
ScriptingException | Unable to save workbook. |
ScenarioFromWorkbook()
Get a new Scenario from the current workbook
Declaration
[Obsolete("This method is deprecated and will be removed in a later release. use Workbook.CurrentScenario instead.")]
public static Scenario ScenarioFromWorkbook()
Returns
Type | Description |
---|---|
Scenario | A Scenario. |
ThrowException()
Throws a ScriptingException.
Declaration
public static void ThrowException()
WriteObjectToJson(Object, String)
Writes data
into json format to filePath
Declaration
public static void WriteObjectToJson(object data, string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | Object to write into json |
System.String | filePath | Output file path of the json file |
WriteRangeToExcel(String, String, String, List<String>)
Writes a range to Excel.
Declaration
public static void WriteRangeToExcel(string filePath, string workSheetName, string rangeName, List<string> data)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to the excel workbook. |
System.String | workSheetName | The worksheet name. |
System.String | rangeName | The range name, or cell range address |
System.Collections.Generic.List<System.String> | data | The data to write to the range. |