Front page

A Technical Guide to Scripting

in WAsP and WAsP Engineering

© 2005-2011, Risø National Laboratory, Denmark

2011-04-05


Welcome

This is our first attempt to provide any written documentation about how to create and edit scripts for use in WAsP and WAsP Engineering.

Unfortunately, there is little or no information directly applicable to WAsP in this version of the documentation.

Who's it for?

The emphasis here is on providing concrete technical information to help advanced users, rather than trying to provide a basic introductory guide for those with no idea how to proceed. There's no 'walkthrough'.

This documentation is for users who have used the existing scripts and imagined some changes or extensions they'd like to make, but found that when they came to look at the scripts and edit them, they could not proceed because there were just too many technical questions or design mysteries.

What's covered?

The information is intended mainly to support reporting in WAsP Engineering: how to extract results data and write them to some kind of external file.


Overview

Both WAsP and WEng support scripting. Scripts can be run from within the main programs. They can be used to:

  • Generate reports
  • Automate tedious operations
  • Extend the basic functionality of the user interface

You can tweak existing scripts, and create new ones

Each script is stored in a separate file. The set of scripts offered by WAsP and WEng is not fixed: you can add new scripts just by adding a file to a particular folder on your computer.

Scripting is achieved by COM automation

Scripts work by using the VBScript language to manipulate the object models provided by WAsP and WEng. Both programs offer a set of COM objects which can be automated. For WAsP, it's the workspace hierarchy and its members. For WEng, it's the project and its domain, winds, sites and so on.

Client automation requires a special licence

Note, though, that the automation will only work within the context of a running WAsP session. To automate the object models from some other client (such as ExcelVBA or Delphi) requires a special "Developer" licence. For more information about obtaining such a licence, contact Risø (wasplicence@risoe.dk).


Differences between WAsP and WEng scripting

WAsP separates the scripts into two groups

WAsP distinguishes between report scripts and utility scripts. They are actually just the same (same format, extension), but are stored in different folders. The distinction is used to govern where the scripts are offered in the GUI. The utility scripts are available from the 'Tools'... menu item 'Utility scripts'. The report scripts appear on the 'Reports' menu item, and in the hierarchy members' pop-up menus.

WEng keeps all the scripts together, and they are available from the 'Tools'... menu item 'Reporting'.

WEng scripts have XML markup around the actual VBScript code

A WEng script is an XML file with various meta-data contained in the elements and attributes. The actual VB script code is included as a single CDATA block.

WAsP scripts have no XML markup: they are standalone-valid VBScript files.

WAsP offers a helpful script error window

If a WAsP script fails, then a special window appears, showing information about the problem and where it arose in the script.

In WEng, a standard error message appears which may or may not explain the error. The execution point in the script is not show.

The WAsP object model has explicit 'Calculate' methods

If you have something in WAsP that can be calculated, like a resource grid, then you may need to call a method to force it to calculate. Otherwise it will have no results or old results.

In WEng, the calculations are kept up to date automatically, and calculated on demand. So simply asking for a data value is enough to invoke all the calculations necessary for the value to be returned.

This difference is reflected in the two programs' user interfaces too, so it's not inconsistent with what see when working with the actual programs.

WAsP provides many more helper objects which the script can use

When a script runs in WAsP, it can use a ready-made object called the ReportingAssistant. This offers a number of powerful helper objects which make it easy to build and display HTML documents, embed images into the output reports, and to format output data.

WEng is not so generous. Scripts running in WEng only have access to a fairly simple helper object called TypeCaster, which offers far fewer services. WEng scripts can't insert images to reports so easily.


The script code is VBScript

In both WAsP and WEng scripts, the actual code which executes is in VBScript.

VBScript is a scripting language which Microsoft developed as an alternative to JScript. It's designed to run in a web browser, and is most commonly used as a way of making HTML pages more powerful. The VBScript code is inserted into the HTML page and runs on the client side. It's a restricted subset of the full Visual Basic language, but is nevertheless a fairly powerful and fully-featured programming language.

You can read more about the language on Microsoft's web site:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vtoriVBScript.asp

That's an excellent guide to the language syntax, though the emphasis is on client side browser code. There's a document there which lists the differences between VBScript and VB/VBA

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsgrpnonfeatures.asp

If you prefer printed matter, then another fairly useful resource is Learning VBScript, by Paul Lomax. Again, the emphasis is on HTML client-side scripting, but there's information about the VBScript language generally, too.

Some 'gotchas'

Watch out for the following traps:

  • You can use Option Explicit, but you can't declare any variables by type: they're all variants
  • VBScript does not support the TypeOf function
  • You can't make implicit typecasts
  • Foo = 32 will not work correctly, but Foo=32 is OK. Somehow the spaces are not handled properly
  • VB Script does not support VB's Format function

Subset of a subset

At the time of writing (2005-11-09)....

For reasons unknown, there seems to be some further limitation on the VBScript language which can be used in WAsP and WEng scripts. If you try to use them, a syntax error arises.

In particular:

  • Select Case statements don't work. You need to use If... ElseIf... Else... EndIf structures instead.

These contradict the documentation. We'll try to work out why and document them more completely. We're currently waiting for some technical support from Microsoft.


The common architecture

Common architectural foundation for WAsP and WEng

WAsP and WEng share a common architectural foundation, with many objects having the same internal representation in both programs. These common interfaces are used for describing data objects such as vector maps and obstacle groups, and for opening and saving files. The interfaces are all declared in a type library called Rvea0027.tlb, which you can find in the \wasp\bin folder.

Some WAsP- and WEng-specific interfaces are defined in that type library.


Creating a grid map specification

Creating a grid map specification (cells-extent type)

You might need to create a grid map specification (for example in order to re-define a project domain in WEng). Here's how...

You need to make use of a helper DLL. At the time of writing (2005-11-09), the right DLL to use is called Rvea0064.

First, use CreateObject to get an ObjectFactory.

Set Factory = CreateObject("Rvea0064.ObjectFactory")

The factory has a method called CreateGridSpecification:

Function CreateGridMapSpecification(MinX As Double, MinY As Double, Columns As Long, Rows As Long, Resolution As Double) As IRveaGridMapSpecificationConfigurable

Note that this is an IRveaGridMapSpecification, in which the dimensions are described in terms of the maximum extent of the cells. The calculation points/nodes are indented by one half resolution from this boundary. See here for a more complete discussion.

So, to create a grid, do the following ...

Set GridMapSpecification = Factory.CreateGridMapSpecification(45200, 31955, 200, 200, 100)


Grids of nodes, or grids of cells?

Confusion

Both WAsP and WEng use regular, rectangular grids. It's possible to think of such grids as arrays of nodes (points), or as arrays of cells. The difference allows some confusions to arise, most importantly ...

"Where are the corners of a grid?"

...which leads to uncertainty about its size as well, of course.

The 'traditional' WAsP approach to thinking about grids is to consider them as a set of points. This corresponds to the Surfer idea too, and matches neatly what's actually happening when calculating a resource grid: a set of site applications are performed. According to this approach, it's natural to describe the grid corners as the sites or points lying at the corners.

An alternative way of thinking about grids is as an image, or bitmap: a grid of cells rather than points. This has its roots in remote sensing data and in GIS grid data display, and is used in bitmap editors. In this approach, the application sites are points which happen to lie in the centre of cells. It follows that the corners of the grid are more naturally described as the extent of the illustrated grid, which is half a resolution further extended in each direction than the points themselves.

Dual representation in IRveaGridSpecification

We confront this issue directly in the IRveaGridSpecification interface, which maintains a dual representation of the grid (as does the companion interface IRveaGridSpecificationConfigurable).

  • Property CellsExtent As IRveaRectangle [r/o]
  • Property Columns As Long [r/o]
  • Property CountOfNodes As Long [r/o]
  • Property NodeLocation(ByVal ColumnIndex As Long, ByVal RowIndex As Long) As IRveaPoint [r/o]
  • Property NodesExtent As IRveaRectangle [r/o]
  • Property Resolution As Single [r/o]
  • Property Rows As Long [r/o]

The distinction is illustrated in the way that resource grids are configured in WAsP, for example:

The old approach persists in places

This approach fixes the ambiguity from which the previous interfaces suffered. Those interfaces (IRveaGridMapSpecification and IRveaGridSpecificationConfigurable) are still used in some places, notably in the way that the domain extent is described in WAsP Engineering 2.0.

If you're working with a grid map specification like this, remember that it uses the "cells-extent" approach, so the array of nodes will lie inside the boundary you define, with a margin of one half-resolution.


Saving things to file

Both WAsP and WEng offer support for saving and exporting data to file. In WAsP, hierarchy members may implement an interface called IExportableHierarchyMember, and in WEng, project members may implement an interface called IExportableProjectMember.

In addition, there's a common approach to saving many WAsP and WEng objects to file, and this approach is actually used by the "Exportable" interfaces in both WAsP and WEng.

There are two key interfaces: IRveaPreservableObject and IRveaPreservableClass.

If an object implements the IRveaPreservableObject interface, then you can (usually) invoke a method called PreserveToFile, and (often) invoke a method called PreserveToXML.

PreserveToFile

The first of these takes a file name as a string argument and just writes itself out to that a file of that name. The file name should be a fully-qualified file name, and should have an extension. Here's an example of saving an obstacle group out from WEng:

Set SiteGroupIterator =
 CurrentProject.Sites.CreateIterator(True)
Set SiteGroupMember = SiteGroupIterator.FirstMember
Set ObstacleGroup = SiteGroupMember.ObstacleGroup
Set PreservableObject =
 TypeCaster.CastObjectToRveaRveaPreservableObject(ObstacleGroup)
OutputFilename = Typecaster.GetTemporaryFileName

PreservableObject.PreserveToFile(OutPutFilename)

By default, the file is written using the most standard format. In the example above, the temporary file name will have a *.tmp extension. The obstacle group will be saved to its default format (corresponding to an *.obs extension). If the file name actually had an *.obs extension, then that would normally force the file-writing code to use that format. If the filename had the alternative *.wog extension, then the file would be written to the XML format for obstacle groups. To get completely explicit control of the output format used, the file filter interfaces must be used. These are described below.

Note that the file name is an optional argument. If the object was originally loaded from file, or has previously been saved to file, then if no file name is passed in, then the existing file name will be re-used.

If Not PreservableObject.Filename = "" Then
PreservableObject.PreserveToFile
End If

PreserveToXML

The preserve to XML method returns a string with properly-formatted XML. To continue the example above:

BunchOfXML = PreservableObject.PreserveToXML

The resulting string would look like this

<WaspObstacleGroup WogVersion="1" Description="Waspdale Airport"
 ObstacleCount="8" GroupOriginX=" 27103.2" GroupOriginY=" 33281.1"><Obstacle
 Height=" 6" Depth=" 30" Porosity=" 0" FirstAngle=" 11" FirstRadius=" 134"
 SecondAngle=" 26" SecondRadius=" 120"/><Obstacle Height=" 6" Depth=" 60"
 Porosity=" 0" FirstAngle=" 26" FirstRadius=" 120" SecondAngle=" 43"
 SecondRadius=" 110"/><Obstacle Height=" 5" Depth=" 16" Porosity=" .4"
 FirstAngle=" 112" FirstRadius=" 500" SecondAngle=" 146" SecondRadius="
 74"/><Obstacle Height=" 4" Depth=" 26" Porosity=" 0" FirstAngle=" 200"
 FirstRadius=" 90" SecondAngle=" 248" SecondRadius=" 76"/><Obstacle Height=" 6"
 Depth=" 46" Porosity=" 0" FirstAngle=" 215" FirstRadius=" 154" SecondAngle="
 237" SecondRadius=" 144"/><Obstacle Height=" 6" Depth=" 6" Porosity=" .7"
 FirstAngle=" 278" FirstRadius=" 116" SecondAngle=" 352" SecondRadius="
 150"/><Obstacle Height=" 6" Depth=" 6" Porosity=" .7" FirstAngle=" 295"
 FirstRadius=" 150" SecondAngle=" 345" SecondRadius=" 196"/><Obstacle Height="
 6" Depth=" 6" Porosity=" .7" FirstAngle=" 305" FirstRadius=" 196"
 SecondAngle=" 341" SecondRadius=" 250"/></WaspObstacleGroup>

Note that there is no prepended processing instruction: this is raw markup.

As with the PreserveToFile method, if there is more than one format defined for XML output for the object, then the default one will be used, unless a file filter is provided.

It's quite possible for an object not to have any XML output format (for example there is currently no XML format for IRveaVectorMaps, in which case an error will arise. You can discover more about how an object can be preserved by using the file filter interfaces, described below.

File filters

Many IRveaPreservableObject objects, like the obstacle groups in the example above, have more than one way to be written to file. Each different format is represented by something called a file filter. To discover the set of filters available for an object, you can use the IRveaPreservableObject's RveaPreservableClass.

Set PreservableClass = PreservableObject.RveaPreservableClass

The IRveaPreservableClass interface has a property called SavingFileFilters, which returns an IRveaFileFilters collection. You can iterate over the collection of filters. Each filter has a one or more file extensions.

Set Filters = PreservableClass.SavingFileFilters
For FilterIndex = 1 To Filters.Count
Set Filter = Filters.FileFilter(FilterIndex)
For ExtensionIndex = 1 To Filter.CountOfExtensions
If Filter.Extension(ExtensionIndex) =
 "wog" Then
PreservableObject.PreserveToFile OutputFilename, Filter
End If
End If
Next

The code above finds and uses the file filter with the extension *.wog.

In a programming context, it's also possible to use type casting to discover whether a particular file filter supports XML output or not, but in the scripting context this is not supported.


Output to MS Excel

Output to a spreadsheet in MS Excel

Automating Excel is easy, and is well documented elsewhere. The Microsoft web site has a large section on the Excel object model (the examples there are in VB.NET, but the object model itself is the same).

In WAsP and WEng scripts, you need to get a reference to an Excel worksheet so that you can start writing output.

Here's a walk-through of some code from a WEng script which shows how to do it:

Get a reference to the application

You need to call the operating system method CreateObject to get Excel

Set xlApp = CreateObject("Excel.application")
xlApp.Visible = True

If there's already an instance of Excel running, then you can use the GetObject method find it. This is how we do it in our scripts...

'Get an excel application reference, if there is one. If not, create one.
On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
On Error GoTo 0
If xlApp Is Nothing Then
Set xlApp = CreateObject("Excel.application")
End If
xlApp.Visible = True

This rather ugly error-trapping code is necessary because we find that GetObject seems to raise an error if Excel is not running. That's not the expected behaviour, but we work around it by trapping the error and using CreateObject to start Excel if necessary. There's probably a more elegant way to do this, and if you find one, then you can just paste it in over our clumsy workaround!

Get a reference to a new worksheet

'Set up a new book and label the first worksheet in it
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.ActiveSheet
xlSheet.Name = "Extreme climate site assessment"

Excel's object model has a hierarchy running from Application, to WorkBook, to WorkSheet, and it's the worksheet you need. The code above adds a new Workbook to the Excel application, and then gets the ActiveSheet (which is the first and only, empty, sheet in the WorkBook.

Formatting the sheet

'Some styles
FontColour = 4194304
Set WengStyle = xlBook.Styles.Add("Weng")
WengStyle.Font.Name = "Tahoma"
WengStyle.Font.Color = FontColour
WengStyle.Font.Size = 10
xlSheet.Cells.Style = WengStyle 'This is the default

Here's how we set up some formatting. You create a style sheet, set some properties and apply it to the cells of the Worksheet.

Writing something to the sheet

You write data to the sheet by using simple assignment statements like this:

xlSheet.Cells(2, 1) = "Using observed extreme wind climate '" & EWC.Description & "'" & " and regional mean wind climate '" & WaspWindAtlas.Description & "'"

The cells are referenced like a two-dimensional array, in (Row,Column) order. That can be a bit confusing because when working in the Excel program itself, we reference cells like this "C5": that's in (column, row) order.


Output to MS Word

Output to a document in MS Word

Automating Word is easy, and is well documented elsewhere. The Microsoft web site has a large section on the Word object model (the examples there are in VB.NET, but the object model itself is the same).

In WAsP and WEng scripts, you need to get a reference to an Word document so that you can start writing output.

Here's a walk-through of some code from a WAsP script which shows how to do it:

Get a reference to the application

You need to call the operating system method CreateObject to get Word

Set WordApplication = CreateObject("Word.Application")
WordApplication.Visible = True

If there's already an instance of Word running, then you can use the GetObject method find it. This is how we do it in our scripts...

'Get an word application reference, if there is one. If not, create one.
On Error Resume Next
Set WordApplication = GetObject(, "Word.Application")
On Error GoTo 0
If WordApplication Is Nothing Then
Set WordApplication = CreateObject("Word.application")
End If
WordApplication.Visible = True

This rather ugly error-trapping code is necessary because we find that GetObject seems to raise an error if Word is not running. That's not the expected behaviour, but we work around it by trapping the error and using CreateObject to start Word if necessary. There's probably a more elegant way to do this, and if you find one, then you can just paste it in over our clumsy workaround!

Get a reference to a new document, with a template

Set Document = WordApplication.Documents.Add(ReportingAssistant.WordTemplateFilename)

Note that you can pass the filename of a template (*.dot) file. In this example from a WAsP script, the ReportingAssistant provides a template filename. To do the same with WEng, you would need to type a stylesheet filename.

Controlling styles from the script itself

If you don't have a template file name to use, or if you want to tweak the template styles, then you can manipulate the document's styles directly from the script code, like this.

Document.Styles(-1).Font.Name = "Tahoma".Styles(-2).Font.Name = "Tahoma".Styles(-3).Font.Name = "Tahoma"
Selection.WholeStory
Selection.Style = Document.Styles(-2)

Getting a selection reference

Word's object model involves heavy use of the 'Selection' object. The code below adds a first paragraph to the empty document and then gets a reference to the selection.

Set Paragraph = Document.Paragraphs.Add
Set Selection = WordApplication.Selection

Writing something to the document

You write text to the document using methods like TypeText and TypeParagraph on the Selection object

Selection.TypeText "Reference conditions"
Selection.TypeParagraph


Output to a text file

Using the FSO

Windows comes with some built-in support for automating a text stream. This is part of something called the FileSystemObject (FSO), which is well documented on the MSDN web site.

You can create an instance of the FSO and then use it to get a TextStream object. You can write out information to this text stream to generate your report, and then save it to file.

Working with a TextStream object

Creating a textstream

You need to create a FSO first, then use that to get a TextStream object. The following code opens the TextStream with a temporary file name.

Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
TempFile = FileSystemObject.GetTempName
Set TextStream = TempFolder.CreateTextFile(TempFile, True)

Writing text to the textstream

This is simple. Just use the methods Write or WriteLine, like this:

TextStream.Write "Weibull-A" & Delimiter
TextStream.WriteLine "Weibull-k" & Delimiter

WriteLine adds a line feed character after the text.

Finishing the write

When you've finished adding text to the stream, you need to close it, like this:

TextStream.Close

What to do with the file?

Once the stream is closed, it's been saved to the file name specified at create time. In the example above, that's a temporary file which will have some incomprehensible name and will be buried along with millions of other files in the \documents and settings\ folder. That's not much use to anyone.

One option is just to open Notepad to display the file. Then the user can just save it to somewhere more convenient if he likes. You can use the scripting context shell command for that:

Set rShell = CreateObject("WScript.Shell")
rShell.Run "Notepad.exe " & TempFile, 1, False

In WAsP, you can use the ReportingAssistant to launch the file

ReportingAssistant.DisplayFileInNotepad TempFile


Output to HTML

HTMLDocumentBuilder

At present, only WAsP has scripts which generate HTML document reports. That's because WAsP scripts have access to an HTMLDocumentBuilder helper object which makes it easy. This is a ready-made object provided by the WAsP ReportingAssistant which is available to WAsP scripts while they execute.

It will be documented in full at a future date.

Other ways to generate HTML

It should be possible to generate an HTML document automating the MS XML/HTML DOM (document object model), but it's not something we've actually done.


Debugging tips

At present, we're not providing any tools for developing and debugging scripts.

In WAsP, there's a helpful error window which appears when a script can't run. It shows the line which failed. There's currently (WEng 2.0D) no such facility in WEng. It might be introduced in a later release.

Syntax errors

If you make a syntax error in the script, then it will fail immediately when you try to run it. Common mistakes include having unbalanced nested conditionals (too many End If statements, for example).

Hard-to-fix things

If you don't use Option Explicit, then even a little typo can cause mysterious problems. You might have an variable called FooBarThing, and assign a value of 5 to it, then later you might try to use the variable, but type FooBorThing, which will just have value zero.

MsgBox is your friend

You can use the MsgBox method to make a little dialog box appear, and show some information.

Sometimes, it's hard to know even how far a script ran before a problem arose. Scattering a few MsgBox commands around the script will help you work it out, for example:

MsgBox "The wind index is " & WindIndex

If the error displayed is something like 'Object variable or with block variable not set', then you can put a test message box in like this

MsgBox "Does it exist? " & Not(SuspectObject Is Nothing)


Common WAsP and WEng interfaces

Common WAsP and WEng interfaces in Rvea0027.tlb

This document provides a listing of some common interfaces defining fundamental wind modelling objects. These are available to both WAsP and WEng.

They are defined in a type library called Rvea0027.tlb. Note that some of these interfaces are depreciated.

A full index of the interfaces in Rvea0027

  • IRveaAnemometerSiteDetails
  • IRveaAnemometerSiteDetailsEditable
  • IRveaAngle
  • IRveaChangeDetectable
  • IRveaChangeObserver
  • IRveaChangeSubject
  • IRveaComponentClient
  • IRveaConfigurable
  • IRveaConfiguration
  • IRveaConfigurationBroker
  • IRveaConfigurationCreateable
  • IRveaConfigurationPreserver
  • IRveaContextInformationProvider
  • IRveaEngineeringWind
  • IRveaExtremeWindClimateGeostrophic
  • IRveaExtremeWindClimateGeostrophicEditable
  • IRveaExtremeWindClimateObserved
  • IRveaExtremeWindClimateObservedEditable
  • IRveaExtremeWindClimateRegional
  • IRveaExtremeWindClimateRegionalEditable
  • IRveaExtremeWindSpeedCondition
  • IRveaExtremeWindSpeedScatterPlotSequence
  • IRveaExtremeWindSpeedScatterPlotSequenceEditable
  • IRveaExtremeWindSpeedScatterPlotSequencePeriod
  • IRveaExtremeWindSpeedScatterPlotSequencePeriodEditable
  • IRveaExtremeWindSpeedScatterPlotSequenceSamplingStructure
  • IRveaExtremeWindSpeedSequence
  • IRveaExtremeWindSpeedSequenceEditable
  • IRveaExtremeWindSpeedSequencePeriod
  • IRveaFileFilter
  • IRveaFileFilters
  • IRveaFrequencyBin
  • IRveaFrequencyBinEditable
  • IRveaFrequencyDistribution
  • IRveaFrequencyDistributionEditable
  • IRveaGridMapSpecification
  • IRveaGridMapSpecificationConfigurable
  • IRveaGridSpecification
  • IRveaGridSpecificationConfigurable
  • IRveaGumbelDistributionSimple
  • IRveaGumbelDistributionWind
  • IRveaGumbelDistributionWindEditable
  • IRveaGumbelDistributionWindRose
  • IRveaGumbelDistributionWindRoseEditable
  • IRveaInstrumentSiteDetails
  • IRveaInstrumentSiteDetailsEditable
  • IRveaLatLongCoordinate
  • IRveaLatLongDegree
  • IRveaLatLongDegreeFraction
  • IRveaObservationSeries
  • IRveaObservationSeriesFieldMetaData
  • IRveaObservedExtremeWindClimate
  • IRveaObservedExtremeWindClimateEditable
  • IRveaObservedWind
  • IRveaObservedWindClimate
  • IRveaObservedWindClimateEditable
  • IRveaObservedWindEditable
  • IRveaObstacle
  • IRveaObstacleEditable
  • IRveaObstacleGroup
  • IRveaObstacleGroupEditable
  • IRveaParameter
  • IRveaParameterDictionary
  • IRveaPoint
  • IRveaPointEditable
  • IRveaPolyLine
  • IRveaPolyLineSet
  • IRveaPortableSite
  • IRveaPortableSiteGroup
  • IRveaPortableSiteGroupMember
  • IRveaPreservableClass
  • IRveaPreservableObject
  • IRveaProductionDistribution
  • IRveaProductionRose
  • IRveaProductionRoseEditable
  • IRveaProductionRoseSector
  • IRveaProductionRoseSectorEditable
  • IRveaProgressMonitor
  • IRveaProgressMonitor2
  • IRveaProgressMonitor3
  • IRveaRealGridMap
  • IRveaRealGridMapCreateable
  • IRveaRectangle
  • IRveaRectangleEditable
  • IRveaRegionalExtremeWindClimate
  • IRveaRegionalExtremeWindClimateEditable
  • IRveaRoseSector
  • IRveaRoseStructureDefinition
  • IRveaRoseStructureDefinitionEditable
  • IRveaRoughnessRose
  • IRveaRoughnessRoseEditable
  • IRveaRoughnessRoseSector
  • IRveaRoughnessRoseSectorEditable
  • IRveaRoughnessRoseSectorZone
  • IRveaRoughnessRoseSectorZoneEditable
  • IRveaSessionEditable
  • IRveaSimpleProductionDistribution
  • IRveaSimpleSpeedProbabilityDistribution
  • IRveaSite
  • IRveaSiteEditable
  • IRveaSourceDataSouvenir
  • IRveaSourceDataSouvenirEditable
  • IRveaTimeRange
  • IRveaTurbulenceDistribution
  • IRveaTurbulenceDistributionDataPoint
  • IRveaTurbulenceDistributionEditable
  • IRveaTurbulenceRose
  • IRveaTurbulenceRoseEditable
  • IRveaTurbulenceRoseSector
  • IRveaTurbulenceRoseSectorEditable
  • IRveaUpwindVelocityDerivatives
  • IRveaVectorMap
  • IRveaWeibullDistribution
  • IRveaWeibullDistributionEditable
  • IRveaWeibullWind
  • IRveaWeibullWindEditable
  • IRveaWeibullWindRose
  • IRveaWeibullWindRoseEditable
  • IRveaWindAtlas
  • IRveaWindAtlasEditable
  • IRveaWindCorrection
  • IRveaWindCorrectionEditable
  • IRveaWindCorrectionRose
  • IRveaWindCorrectionRoseEditable
  • IRveaWindTurbineGenerator
  • IRveaWindTurbineGeneratorEditable
  • IRveaWtgPerformanceTable
  • IRveaWtgPerformanceTableDataPoint
  • IRveaWtgPerformanceTableEditable
  • IRveaXMLFilter

IRveaAnemometerSiteDetails

  • Property AnemometerHeightAgl As Single [r/o]
  • Property Description As String [r/o]
  • Property LatitudeDegrees As Single [r/o]
  • Property LongitudeDegrees As Single [r/o]

IRveaAnemometerSiteDetailsEditable

  • Property AnemometerHeightAgl As Single [r/w]
  • Property Description As String [r/w]
  • Property LatitudeDegrees As Single [r/w]
  • Property LongitudeDegrees As Single [r/w]

IRveaAngle

  • Property Degrees As Single [r/o]
  • Property Radians As Single [r/o]

IRveaChangeDetectable

  • Property DataIdentity As String [r/o]

IRveaChangeObserver

  • Sub NotifyChange(ByVal ChangeSubject As IRveaChangeSubject, [ByVal ChangingObject As Object = Nothing])

IRveaChangeSubject

  • Sub SubscribeObserver(ByVal Observer As IRveaChangeObserver)
  • Sub UnsubscribeObserver(ByVal Observer As IRveaChangeObserver)

IRveaComponentClient

  • Property ApplicationHelpFile As String [r/o]
  • Property ApplicationTitle As String [r/o]
  • Property ProgressMonitor As IRveaProgressMonitor2 [r/o]

IRveaConfigurable

  • Property Configuration As IRveaConfiguration [r/o]

IRveaConfiguration

  • Property NumberOfParameters As Long [r/o]
  • Property ParameterByID(ByVal ID As String) As IRveaParameter [r/o]
  • Property ParameterByIndex(ByVal Index As Long) As IRveaParameter [r/o]
  • Function ReportConfigurationProblems() As String

IRveaConfigurationBroker

  • Property Count As Long [r/o]
  • Property Item(ByVal Index As Long) As IRveaConfiguration [r/o]
  • Property UnifiedConfiguration As IRveaConfiguration [r/o]
  • Sub Add(ByVal Configuration As IRveaConfiguration)
  • Sub Clear()
  • Sub Remove(ByVal Configuration As IRveaConfiguration)

IRveaConfigurationCreateable

  • Property NumberOfParameters As Long [r/o]
  • Property ParameterByID(ByVal ID As String) As IRveaParameter [r/o]
  • Property ParameterByIndex(ByVal Index As Long) As IRveaParameter [r/o]
  • Function Add(ByVal ID As String, ByVal DefaultValue As Variant, ByVal ValidRange As Variant, [ByVal SupportURL As String]) As IRveaParameter
  • Sub ClearAll()
  • Function ReportConfigurationProblems() As String

IRveaConfigurationPreserver

  • Sub PreserveConfiguration(ByVal SourceConfiguration As IRveaConfiguration, ByVal Filename As String)
  • Function PreserveConfigurationToXML(ByVal SourceConfiguration As IRveaConfiguration) As String
  • Sub RestoreConfiguration(ByVal TargetConfiguration As IRveaConfiguration, ByVal Filename As String)
  • Sub RestoreConfigurationFromXML(ByVal TargetConfiguration As IRveaConfiguration, ByVal XMLString As String)

IRveaContextInformationProvider

  • Property CountOfElements As Long [r/o]
  • Property ElementContents(ByVal Index As Long) As String [r/o]
  • Property ElementName(ByVal Index As Long) As String [r/o]
  • Sub AddElement(ByVal ElementContents As String)

IRveaEngineeringWind

  • Property Direction As Single [r/o]
  • Property LocationX As Single [r/o]
  • Property LocationY As Single [r/o]
  • Property MeasurementHeightAGL As Single [r/o]
  • Property MeasurementRoughnessLength As Single [r/o]
  • Property Speed As Single [r/o]
  • Property WindType As eEngineeringWindType [r/o]

IRveaExtremeWindClimateGeostrophic

  • Property Location As IRveaLatLongCoordinate [r/o]
  • Property ScatterPlotSequence As IRveaExtremeWindSpeedScatterPlotSequence [r/o]

IRveaExtremeWindClimateGeostrophicEditable

  • Property Location As IRveaLatLongCoordinate [r/o]
  • Property ScatterPlotSequence As IRveaExtremeWindSpeedScatterPlotSequenceEditable [r/o]

IRveaExtremeWindClimateObserved

  • Property ObservationSiteDetails As IRveaInstrumentSiteDetails [r/o]
  • Property ScatterPlotSequence As IRveaExtremeWindSpeedScatterPlotSequence [r/o]

IRveaExtremeWindClimateObservedEditable

  • Property ObservationSiteDetails As IRveaInstrumentSiteDetailsEditable [r/o]
  • Property ScatterPlotSequence As IRveaExtremeWindSpeedScatterPlotSequenceEditable [r/o]

IRveaExtremeWindClimateRegional

  • Property Latitude As IRveaLatLongDegree [r/o]
  • Property MeasurementHeightAGL As Single [r/o]
  • Property MeasurementRoughnessLength As Single [r/o]
  • Property ScatterPlotSequence As IRveaExtremeWindSpeedScatterPlotSequence [r/o]

IRveaExtremeWindClimateRegionalEditable

  • Property Latitude As IRveaLatLongDegree [r/o]
  • Property MeasurementHeightAGL As Single [r/o]
  • Property MeasurementRoughnessLength As Single [r/o]
  • Property ScatterPlotSequence As IRveaExtremeWindSpeedScatterPlotSequenceEditable [r/o]

IRveaExtremeWindSpeedCondition

  • Property CorrespondingWindDirectionDegrees As Single [r/o]
  • Property MeanWindSpeed As Single [r/o]
  • Property OriginalRecordingTimeStamp As Date [r/o]
  • Property SpeedAveragingPeriodSeconds As Single [r/o]
  • Property SpeedRecordingIntervalSeconds As Single [r/o]

IRveaExtremeWindSpeedScatterPlotSequence

  • Property AsSpeedSequence As IRveaExtremeWindSpeedSequence [r/o]
  • Property CountOfPeriods As Long [r/o]
  • Property DurationYears As Single [r/o]
  • Property MaximumSpeed As Single [r/o]
  • Property PeriodByIndex(ByVal Index As Long) As IRveaExtremeWindSpeedScatterPlotSequencePeriod [r/o]
  • Property PeriodByRankAscending(ByVal RankIndex As Long) As IRveaExtremeWindSpeedScatterPlotSequencePeriod [r/o]
  • Property SamplingStructure As IRveaExtremeWindSpeedScatterPlotSequenceSamplingStructure [r/o]

IRveaExtremeWindSpeedScatterPlotSequenceEditable

  • Property AsSpeedSequence As IRveaExtremeWindSpeedSequence [r/o]
  • Property CountOfPeriods As Long [r/o]
  • Property DurationYears As Single [r/o]
  • Property MaximumSpeed As Single [r/o]
  • Property PeriodByIndex(ByVal Index As Long) As IRveaExtremeWindSpeedScatterPlotSequencePeriodEditable [r/o]
  • Property PeriodByRankAscending(ByVal RankIndex As Long) As IRveaExtremeWindSpeedScatterPlotSequencePeriodEditable [r/o]
  • Property SamplingStructure As IRveaExtremeWindSpeedScatterPlotSequenceSamplingStructure [r/o]
  • Function AppendPeriod() As IRveaExtremeWindSpeedScatterPlotSequencePeriodEditable

IRveaExtremeWindSpeedScatterPlotSequencePeriod

  • Property CountOfPoints As Long [r/o]
  • Property DurationYears As Single [r/o]
  • Property PointByIndex(ByVal Index As Long) As IRveaExtremeWindSpeedCondition [r/o]
  • Property PointWithMaximumSpeed As IRveaExtremeWindSpeedCondition [r/o]

IRveaExtremeWindSpeedScatterPlotSequencePeriodEditable

  • Property CountOfPoints As Long [r/o]
  • Property DurationYears As Single [r/o]
  • Property PointByIndex(ByVal Index As Long) As IRveaExtremeWindSpeedCondition [r/o]
  • Property PointWithMaximumSpeed As IRveaExtremeWindSpeedCondition [r/o]
  • Sub AddPoint(ByVal TimeStamp As Date, ByVal WindSpeed As Single, ByVal WindDirection As Single, ByVal SpeedAveragingPeriodSeconds As Single, ByVal SpeedRecordingIntervalSeconds As Single)

IRveaExtremeWindSpeedScatterPlotSequenceSamplingStructure

  • Property NumberOfDirectionBins As Long [r/o]
  • Property NumberOfEventsPerBin As Long [r/o]
  • Property PeriodDurationYears As Single [r/o]

IRveaExtremeWindSpeedSequence

  • Property CountOfPeriods As Long [r/o]
  • Property DurationYears As Single [r/o]
  • Property GumbelDistribution As IRveaGumbelDistributionSimple [r/o]
  • Property MaximumSpeed As Single [r/o]
  • Property PeriodByIndex(ByVal Index As Long) As IRveaExtremeWindSpeedSequencePeriod [r/o]
  • Property PeriodByRankAscending(ByVal RankIndex As Long) As IRveaExtremeWindSpeedSequencePeriod [r/o]
  • Function GetUncertaintyForInterval(ByVal IntervalYears As Single) As Single

IRveaExtremeWindSpeedSequenceEditable

  • Property CountOfPeriods As Long [r/o]
  • Property DurationYears As Single [r/o]
  • Property GumbelDistribution As IRveaGumbelDistributionSimple [r/o]
  • Property PeriodByIndex(ByVal Index As Long) As IRveaExtremeWindSpeedSequencePeriod [r/o]
  • Property PeriodByRankAscending(ByVal RankIndex As Long) As IRveaExtremeWindSpeedSequencePeriod [r/o]
  • Sub AppendPeriod(ByVal MaximumSpeed As Single)
  • Function GetUncertaintyForInterval(ByVal IntervalYears As Single) As Single

IRveaExtremeWindSpeedSequencePeriod

  • Property DurationYears As Single [r/o]
  • Property MaximumSpeed As Single [r/o]

IRveaFileFilter

  • Property CountOfExtensions As Long [r/o]
  • Property Description As String [r/o]
  • Property Extension([ByVal ExtensionIndex As Long]) As String [r/o]

IRveaFileFilters

  • Property Count As Long [r/o]
  • Property FileFilter([ByVal FileFilterIndex As Long]) As IRveaFileFilter [r/o]

IRveaFrequencyBin

  • Property Frequency As Single [r/o]
  • Property UpperLimit As Single [r/o]
  • Property Width As Single [r/o]

IRveaFrequencyBinEditable

  • Property Frequency As Single [r/w]
  • Property UpperLimit As Single [r/o]
  • Property Width As Single [r/o]

IRveaFrequencyDistribution

  • Property BinByIndex(ByVal Index As Long) As IRveaFrequencyBin [r/o]
  • Property BinByValue(ByVal Value As Single) As IRveaFrequencyBin [r/o]
  • Property CountOfBins As Long [r/o]
  • Property HighestFrequency As Single [r/o]
  • Property HighestSpeed As Single [r/o]
  • Property IndexOfBinByValue(ByVal Value As Single) As Long [r/o]
  • Property WeibullDistribution As IRveaWeibullDistribution [r/o]

IRveaFrequencyDistributionEditable

  • Property BinByIndex(ByVal Index As Long) As IRveaFrequencyBinEditable [r/o]
  • Property BinByValue(ByVal Value As Single) As IRveaFrequencyBinEditable [r/o]
  • Property CountOfBins As Long [r/o]
  • Property HighestFrequency As Single [r/o]
  • Property HighestSpeed As Single [r/o]
  • Property IndexOfBinByValue(ByVal Value As Single) As Long [r/o]
  • Property WeibullDistribution As IRveaWeibullDistribution [r/o]
  • Function AppendBin(ByVal BinWidth As Single) As IRveaFrequencyBinEditable
  • Sub ClearBins()

IRveaGridMapSpecification

  • Property AsIRveaRectangle As IRveaRectangle [r/o]
  • Property Columns As Long [r/o]
  • Property MinimumX As Single [r/o]
  • Property MinimumY As Single [r/o]
  • Property Resolution As Single [r/o]
  • Property Rows As Long [r/o]

IRveaGridMapSpecificationConfigurable

  • Property AsIRveaRectangle As IRveaRectangle [r/o]
  • Property Columns As Long [r/o]
  • Property FavourXDimensionWhenDerivingResolution As Boolean [r/w]
  • Property IsSatisfactory As Boolean [r/o]
  • Property MinimumX As Single [r/o]
  • Property MinimumY As Single [r/o]
  • Property Resolution As Single [r/o]
  • Property Rows As Long [r/o]
  • Sub MoveRealWorldLocation(ByVal NewMinimumX As Single, ByVal NewMinimumY As Single)
  • Sub SetColumns(ByVal Columns As Long, [ByVal PreserveResolution As Boolean = True], [ByVal FavourLowerX As Boolean = True], [ByVal FavourLowerY As Boolean = True])
  • Sub SetRealWorldCorners(ByVal FavouredX As Single, ByVal OtherX As Single, ByVal FavouredY As Single, ByVal OtherY As Single, [ByVal PreserveResolution As Boolean = True])
  • Sub SetResolution(ByVal Resolution As Single, [ByVal PreserveRowsAndColumns As Boolean = False], [ByVal FavourLowerX As Boolean = True], [ByVal FavourLowerY As Boolean = True])
  • Sub SetRows(ByVal Rows As Long, [ByVal PreserveResolution As Boolean = True], [ByVal FavourLowerX As Boolean = True], [ByVal FavourLowerY As Boolean = True])

IRveaGridSpecification

  • Property CellsExtent As IRveaRectangle [r/o]
  • Property Columns As Long [r/o]
  • Property CountOfNodes As Long [r/o]
  • Property NodeLocation(ByVal ColumnIndex As Long, ByVal RowIndex As Long) As IRveaPoint [r/o]
  • Property NodesExtent As IRveaRectangle [r/o]
  • Property Resolution As Single [r/o]
  • Property Rows As Long [r/o]

IRveaGridSpecificationConfigurable

  • Property CellsExtent As IRveaRectangle [r/o]
  • Property Columns As Long [r/o]
  • Property CountOfNodes As Long [r/o]
  • Property FavourNodesWhenApplyingPrecisionLimit As Boolean [r/w]
  • Property FavourXDimensionWhenDerivingResolution As Boolean [r/w]
  • Property IsSatisfactory As Long [r/o]
  • Property NodeLocation(ByVal ColumnIndex As Long, ByVal RowIndex As Long) As IRveaPoint [r/o]
  • Property NodesExtent As IRveaRectangle [r/o]
  • Property PrecisionLimit As Single [r/w]
  • Property Resolution As Single [r/o]
  • Property Rows As Long [r/o]
  • Sub MoveCellsExtent(ByVal NewMinimumX As Single, ByVal NewMinimumY As Single)
  • Sub MoveNodesExtent(ByVal NewMinimumX As Single, ByVal NewMinimumY As Single)
  • Sub SetColumns(ByVal Columns As Long, [ByVal PreserveResolution As Boolean = True], [ByVal FavourLowerX As Boolean = True], [ByVal FavourLowerY As Boolean = True], [ByVal FavourNodeLocations As Boolean = True])
  • Sub SetCornersCellsExtent(ByVal FavouredX As Single, ByVal OtherX As Single, ByVal FavouredY As Single, ByVal OtherY As Single, [ByVal PreserveResolution As Boolean = True])
  • Sub SetCornersNodesExtent(ByVal FavouredX As Single, ByVal OtherX As Single, ByVal FavouredY As Single, ByVal OtherY As Single, [ByVal PreserveResolution As Boolean = True])
  • Sub SetResolution(ByVal Resolution As Single, [ByVal PreserveRowsAndColumns As Boolean = False], [ByVal FavourLowerX As Boolean = True], [ByVal FavourLowerY As Boolean = True], [ByVal FavourNodeLocations As Boolean = True])
  • Sub SetRows(ByVal Rows As Long, [ByVal PreserveResolution As Boolean = True], [ByVal FavourLowerX As Boolean = True], [ByVal FavourLowerY As Boolean = True], [ByVal FavourNodeLocations As Boolean = True])

IRveaGumbelDistributionSimple

  • Property AlphaParameter As Single [r/o]
  • Property DefiningIntervalYears As Single [r/o]
  • Property DefiningSpeed As Single [r/o]
  • Function GetMaximumSpeedForInterval(ByVal IntervalYears As Single) As Single

IRveaGumbelDistributionWind

  • Property GumbelDistribution As IRveaGumbelDistributionSimple [r/o]
  • Property Sector As IRveaRoseSector [r/o]

IRveaGumbelDistributionWindEditable

  • Property GumbelDistribution As IRveaGumbelDistributionSimple [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Sub SetupDistribution(ByVal AlphaParameter As Single, ByVal DefiningSpeed As Single, ByVal DefiningIntervalYears As Single)

IRveaGumbelDistributionWindRose

  • Property CombinedOmniDirectionalGumbelDistribution As IRveaGumbelDistributionSimple [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindBySectorIndex(ByVal Index As Long) As IRveaGumbelDistributionWind [r/o]
  • Property WindForAngleDegrees(ByVal Angle As Single) As IRveaGumbelDistributionWind [r/o]
  • Property WindWithHighestDefiningSpeed As IRveaGumbelDistributionWind [r/o]
  • Property WindWithLowestDefiningSpeed As IRveaGumbelDistributionWind [r/o]

IRveaGumbelDistributionWindRoseEditable

  • Property CombinedOmniDirectionalGumbelDistribution As IRveaGumbelDistributionSimple [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindBySectorIndex(ByVal Index As Long) As IRveaGumbelDistributionWindEditable [r/o]
  • Property WindForAngleDegrees(ByVal Angle As Single) As IRveaGumbelDistributionWindEditable [r/o]
  • Property WindWithHighestDefiningSpeed As IRveaGumbelDistributionWind [r/o]
  • Property WindWithLowestDefiningSpeed As IRveaGumbelDistributionWind [r/o]

IRveaInstrumentSiteDetails

  • Property Description As String [r/o]
  • Property InstrumentHeightAgl As Single [r/o]
  • Property IsSiteElevationAslSet As Boolean [r/o]
  • Property LatLongLocation As IRveaLatLongCoordinate [r/o]
  • Property SiteElevationAsl As Single [r/o]
  • Property SiteMapLocation As IRveaPoint [r/o]

IRveaInstrumentSiteDetailsEditable

  • Property Description As String [r/w]
  • Property InstrumentHeightAgl As Single [r/w]
  • Property IsSiteElevationAslSet As Boolean [r/o]
  • Property LatLongLocation As IRveaLatLongCoordinate [r/o]
  • Property SiteElevationAsl As Single [r/w]
  • Property SiteMapLocation(ByVal DoCreateIfMissing As Boolean) As IRveaPointEditable [r/o]

IRveaLatLongCoordinate

  • Property Latitude As IRveaLatLongDegree [r/o]
  • Property Longitude As IRveaLatLongDegree [r/o]
  • Function IsEqualTo(ByVal ComparisonCoordinate As IRveaLatLongCoordinate) As Boolean
  • Sub MakeEqualTo(ByVal SourceCoordinate As IRveaLatLongCoordinate)

IRveaLatLongDegree

  • Property Degrees As IRveaLatLongDegreeFraction [r/o]
  • Property Minutes As IRveaLatLongDegreeFraction [r/o]
  • Property Seconds As IRveaLatLongDegreeFraction [r/o]
  • Property WhichPartHasDecimal As eLatLongDegreeDecimalFractionSelector [r/o]
  • Sub SetByDegrees(ByVal Degrees As Double)
  • Sub SetByDegreesAndMinutes(ByVal Degrees As Long, ByVal Minutes As Double)
  • Sub SetByDegreesMinutesAndSeconds(ByVal Degrees As Long, ByVal Minutes As Long, ByVal Seconds As Double)

IRveaLatLongDegreeFraction

  • Property DecimalPart As Double [r/o]
  • Property IntegerPart As Long [r/o]
  • Property MaximumValueLimit As Long [r/o]
  • Property MinimumValueLimit As Long [r/o]
  • Property ValueAsDecimal As Double [r/o]

IRveaObservationSeries

  • Property CalmThreshold As Single [r/o]
  • Property CountOfFields As Long [r/o]
  • Property CountOfRecords As Long [r/o]
  • Property DatumValue(ByVal RecordIndex As Long, ByVal FieldIndex As Long) As Single [r/o]
  • Property FieldMetaData(ByVal FieldIndex As Long) As IRveaObservationSeriesFieldMetaData [r/o]
  • Property IndexOfNamedField(ByVal NamedFieldID As eNamedObservationSeriesFieldID) As Long [r/o]
  • Property ObservationPeriod As IRveaTimeRange [r/o]
  • Property RecordIndexNearestToTimeStamp(ByVal TimeStamp As Double) As Long [r/o]
  • Property RecordingIntervalDays As Double [r/o]
  • Property RecordTimeStamp(ByVal RecordIndex As Long) As Double [r/o]
  • Property StartTime As Double [r/o]

IRveaObservationSeriesFieldMetaData

  • Property CalmThreshold As Single [r/o]
  • Property DiscretisationWidth As Single [r/o]
  • Property FlagValue As Single [r/o]
  • Property Name As String [r/o]
  • Property NamedFieldID As eNamedObservationSeriesFieldID [r/o]
  • Property SamplingPeriodDays As Double [r/o]
  • Property Units As String [r/o]

IRveaObservedExtremeWindClimate

  • Property AnemometerSiteDetails As IRveaAnemometerSiteDetails [r/o]
  • Property ExtremeWindRose As IRveaExtremeWindRose [r/o]
  • Property SourceDataSouvenir As IRveaSourceDataSouvenir [r/o]

IRveaObservedExtremeWindClimateEditable

  • Property AnemometerSiteDetails As IRveaAnemometerSiteDetailsEditable [r/o]
  • Property ExtremeWindRose As IRveaExtremeWindRoseEditable [r/o]
  • Property SourceDataSouvenir As IRveaSourceDataSouvenirEditable [r/o]

IRveaObservedWind

  • Property Sector As IRveaRoseSector [r/o]
  • Property SectorFrequency As Single [r/o]
  • Property SpeedFrequencyDistribution As IRveaFrequencyDistribution [r/o]

IRveaObservedWindClimate

  • Property AnemometerSiteDetails As IRveaAnemometerSiteDetails [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property OmniDirectionalDistribution As IRveaFrequencyDistribution [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindForAngleDegrees(ByVal Angle As Single) As IRveaObservedWind [r/o]
  • Property WindForSectorIndex(ByVal Index As Long) As IRveaObservedWind [r/o]
  • Property WindWithHighestDistributionFrequency As IRveaObservedWind [r/o]
  • Property WindWithHighestSectorFrequency As IRveaObservedWind [r/o]
  • Property WindWithHighestSpeed As IRveaObservedWind [r/o]

IRveaObservedWindClimateEditable

  • Property AnemometerSiteDetails As IRveaAnemometerSiteDetailsEditable [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property OmniDirectionalDistribution As IRveaFrequencyDistributionEditable [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindForAngleDegrees(ByVal Angle As Single) As IRveaObservedWindEditable [r/o]
  • Property WindForSectorIndex(ByVal Index As Long) As IRveaObservedWindEditable [r/o]
  • Property WindWithHighestDistributionFrequency As IRveaObservedWindEditable [r/o]
  • Property WindWithHighestSectorFrequency As IRveaObservedWindEditable [r/o]
  • Property WindWithHighestSpeed As IRveaObservedWindEditable [r/o]

IRveaObservedWindEditable

  • Property Sector As IRveaRoseSector [r/o]
  • Property SectorFrequency As Single [r/w]
  • Property SpeedFrequencyDistribution As IRveaFrequencyDistributionEditable [r/o]

IRveaObstacle

  • Property BoundingRectangle As IRveaRectangle [r/o]
  • Property Corner(ByVal Index As Long) As IRveaPoint [r/o]
  • Property Depth As Single [r/o]
  • Property Description As String [r/o]
  • Property DoesContainPoint(ByVal QueryX As Single, ByVal QueryY As Single) As Boolean [r/o]
  • Property FirstAngle As Single [r/o]
  • Property FirstRadius As Single [r/o]
  • Property Height As Single [r/o]
  • Property Porosity As Single [r/o]
  • Property SecondAngle As Single [r/o]
  • Property SecondRadius As Single [r/o]

IRveaObstacleEditable

  • Property AsIRveaObstacle As IRveaObstacle [r/o]
  • Property BoundingRectangle As IRveaRectangle [r/o]
  • Property Corner(ByVal Index As Long) As IRveaPoint [r/o]
  • Property Depth As Single [r/w]
  • Property Description As String [r/w]
  • Property DoesContainPoint(ByVal QueryX As Single, ByVal QueryY As Single) As Boolean [r/o]
  • Property FirstAngle As Single [r/w]
  • Property FirstRadius As Single [r/w]
  • Property Height As Single [r/w]
  • Property Porosity As Single [r/w]
  • Property SecondAngle As Single [r/w]
  • Property SecondRadius As Single [r/w]
  • Sub MoveByPolar(ByVal FirstAngle As Single, ByVal FirstRadius As Single, ByVal SecondAngle As Single, ByVal SecondRadius As Single)
  • Sub MoveCorner(ByVal CornerIndex As Long, ByVal NewX As Single, ByVal NewY As Single, ByVal DoAllowTwist As Boolean)

IRveaObstacleGroup

  • Property BoundingRectangle As IRveaRectangle [r/o]
  • Property Count As Long [r/o]
  • Property Description As String [r/o]
  • Property First As IRveaObstacle [r/o]
  • Property IsLast As Boolean [r/o]
  • Property Next As IRveaObstacle [r/o]
  • Property ObstaclesAtCoordinate(ByVal QueryX As Single, ByVal QueryY As Single) As IRveaObstacleGroup [r/o]
  • Property Origin As IRveaPoint [r/o]

IRveaObstacleGroupEditable

  • Property BoundingRectangle As IRveaRectangle [r/o]
  • Property Count As Long [r/o]
  • Property Description As String [r/w]
  • Property First As IRveaObstacleEditable [r/o]
  • Property IsLast As Boolean [r/o]
  • Property Next As IRveaObstacleEditable [r/o]
  • Property ObstaclesAtCoordinate(ByVal QueryX As Single, ByVal QueryY As Single) As IRveaObstacleGroup [r/o]
  • Property Origin As IRveaPoint [r/o]
  • Function AddObstacleByCartesian(ByVal Porosity As Single, ByVal Depth As Single, ByVal Height As Single, ByVal FirstPointX As Single, ByVal FirstPointY As Single, ByVal SecondPointX As Single, ByVal SecondPointY As Single) As IRveaObstacleEditable
  • Function AddObstacleByCopy(ByVal SourceObstacle As IRveaObstacle, [ByVal ObstacleIsOriginRelative As Boolean = False]) As IRveaObstacleEditable
  • Function AddObstacleByPolar(ByVal Porosity As Single, ByVal Depth As Single, ByVal Height As Single, ByVal FirstAngle As Single, ByVal FirstRadius As Single, ByVal SecondAngle As Single, ByVal SecondRadius As Single) As IRveaObstacleEditable
  • Sub MoveGroupOrigin(ByVal NewX As Single, ByVal NewY As Single, ByVal ShiftObstacleLocations As Boolean)
  • Sub MoveOrigin(ByVal NewX As Single, ByVal NewY As Single)
  • Sub RemoveObstacle(ByVal DoomedObstacle As IRveaObstacle)

IRveaParameter

  • Property DefaultValue As Variant [r/o]
  • Property ID As String [r/o]
  • Property SupportURL As String [r/o]
  • Property ValidRange As Variant [r/o]
  • Property Value As Variant [r/w]
  • Function IsValueValid(ByVal Valu As Variant) As Boolean

IRveaParameterDictionary

  • Property Count As Long [r/o]
  • Property Description(ByVal ID As String, ByVal Default As String) As String [r/o]
  • Property ID(ByVal Index As Long) As String [r/o]
  • Property SuggestedEditGroup(ByVal ID As String) As String [r/o]

IRveaPoint

  • Property x As Single [r/o]
  • Property y As Single [r/o]

IRveaPointEditable

  • Property x As Single [r/w]
  • Property y As Single [r/w]

IRveaPolyLine

  • Property Elevation As Single [r/o]
  • Property HasElevation As Boolean [r/o]
  • Property HasRoughnessChange As Boolean [r/o]
  • Property ID As String [r/o]
  • Property IsBoundary As Boolean [r/o]
  • Property LeftSideRoughness As Single [r/o]
  • Property NumberOfPoints As Long [r/o]
  • Property Point(ByVal Index As Long) As RveaLinePoint [r/o] [default]
  • Property Points As RveaLinePoint [r/o]
  • Property RightSideRoughness As Single [r/o]

IRveaPolyLineSet

  • Property Count As Long [r/o]
  • Function FindNearest(ByRef QueryPoint As RveaLinePoint) As IRveaPolyLine
  • Function IsLast() As Boolean
  • Function Next() As IRveaPolyLine
  • Sub Reset()

IRveaPortableSite

  • Property Description As String [r/o]
  • Property HeightAgl As Single [r/o]
  • Property Location As IRveaPoint [r/o]
  • Property SiteType As eSiteType [r/o]

IRveaPortableSiteGroup

  • Property Count As Long [r/o]
  • Property Description As String [r/o]
  • Property Member(ByVal Index As Long) As IRveaPortableSiteGroupMember [r/o]
  • Property SitesCountRecursive As Long [r/o]

IRveaPortableSiteGroupMember

  • Property AsGroup As IRveaPortableSiteGroup [r/o]
  • Property AsSite As IRveaPortableSite [r/o]
  • Property AssociatedObject(ByVal Index As Long) As IRveaPreservableObject [r/o]
  • Property CountOfAssociatedObjects As Long [r/o]
  • Property Description As String [r/o]

IRveaPreservableClass

  • Property Description As String [r/o]
  • Property OpeningFileFilters As IRveaFileFilters [r/o]
  • Property SavingFileFilters As IRveaFileFilters [r/o]
  • Function RestoreInstanceFromFile(ByVal Filename As String, [ByVal Filter As IRveaFileFilter]) As IRveaPreservableObject
  • Function RestoreInstanceFromXML(ByVal XMLString As String, [ByVal Filter As IRveaXMLFilter]) As IRveaPreservableObject

IRveaPreservableObject

  • Property Filename As String [r/w]
  • Property IsUnsaved As Boolean [r/w]
  • Property RveaPreservableClass As IRveaPreservableClass [r/o]
  • Sub PreserveToFile([ByVal Filename As String], [ByVal Filter As IRveaFileFilter])
  • Function PreserveToXML([ByVal Filter As IRveaXMLFilter]) As String
  • Sub RestoreFromFile([ByVal Filename As String], [ByVal Filter As IRveaFileFilter])
  • Sub RestoreFromXML(ByVal XMLString As String, [ByVal Filter As IRveaXMLFilter])

IRveaProductionDistribution

  • Property AnnualProduction As Single [r/o]
  • Property MaximumProduction As Single [r/o]
  • Property ProductionForSpeed(ByVal Speed As Single) As Single [r/o]
  • Property SpeedOfMaximumProduction As Single [r/o]
  • Property WeibullDistribution As IRveaWeibullDistribution [r/o]

IRveaProductionRose

  • Property CountOfSectors As Long [r/o]
  • Property EmergentProductionDistribution As IRveaSimpleProductionDistribution [r/o]
  • Property OmniDirectionalDistribution As IRveaProductionDistribution [r/o]
  • Property SectorForAngleDegrees(ByVal Angle As Single) As IRveaProductionRoseSector [r/o]
  • Property SectorForIndex(ByVal Index As Long) As IRveaProductionRoseSector [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property SectorWithHighestGrossContribution As IRveaProductionRoseSector [r/o]
  • Property SumOfSectorsAnnualGrossProduction As Single [r/o]
  • Property SumOfSectorsAnnualNetProduction As Single [r/o]

IRveaProductionRoseEditable

  • Property CountOfSectors As Long [r/o]
  • Property EmergentProductionDistribution As IRveaSimpleProductionDistribution [r/o]
  • Property OmniDirectionalDistribution As IRveaProductionDistribution [r/o]
  • Property SectorForAngleDegrees(ByVal Angle As Single) As IRveaProductionRoseSectorEditable [r/o]
  • Property SectorForIndex(ByVal Index As Long) As IRveaProductionRoseSectorEditable [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property SectorWithHighestGrossContribution As IRveaProductionRoseSectorEditable [r/o]
  • Property SumOfSectorsAnnualGrossProduction As Single [r/o]
  • Property SumOfSectorsAnnualNetProduction As Single [r/o]

IRveaProductionRoseSector

  • Property GrossContribution As Single [r/o]
  • Property NetContribution As Single [r/o]
  • Property ProductionDistribution As IRveaProductionDistribution [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property SectorFrequency As Single [r/o]
  • Property WakeLossProportion As Single [r/o]

IRveaProductionRoseSectorEditable

  • Property GrossContribution As Single [r/o]
  • Property NetContribution As Single [r/o]
  • Property ProductionDistribution As IRveaProductionDistribution [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property SectorFrequency As Single [r/w]
  • Property WakeLossProportion As Single [r/w]

IRveaProgressMonitor

  • Function ReportProgress(ByVal Percent As Long) As Boolean

IRveaProgressMonitor2

  • Property CurrentActivityDescription As String [r/o]
  • Property HasUserRequestedCancel As Boolean [r/o]
  • Function BeginJobAndReturnTag(ByVal ActivityDescription As String, [ByVal CanBeCancelled As Boolean = False]) As String
  • Sub EndJob(ByVal JobTag As String)
  • Function ReportProgress(ByVal Percent As Long, [ByVal UpdatedActivityDescription As String = ""], [ByVal DoNotInitiateDisplay As Boolean = False]) As Boolean

IRveaProgressMonitor3

  • Property CurrentActivityDescription As String [r/o]
  • Property HasUserRequestedCancel As Boolean [r/o]
  • Property IsJobStillInStack(ByVal JobTag As String) As Boolean [r/o]
  • Function BeginJobAndReturnTag(ByVal ActivityDescription As String, ByVal CanBeCancelled As Boolean) As String
  • Sub EndJob(ByVal JobTag As String)
  • Sub ImplementPartialCancellation(ByVal ContinuationLevelJobTag As String)
  • Function ReportProgress(ByVal Percent As Long, [ByVal UpdatedActivityDescription As String = ""], [ByVal DoNotInitiateDisplay As Boolean = False]) As Boolean

IRveaRealGridMap

  • Property CellValue(ByVal x As Long, ByVal y As Long) As Single [r/o]
  • Property Columns As Long [r/o]
  • Property Extent As IRveaRectangle [r/o]
  • Property FlagValue As Single [r/o]
  • Property MaximumValue([ByVal SupressReEvaluation As Boolean = False]) As Single [r/o]
  • Property MinimumValue([ByVal SupressReEvaluation As Boolean = False]) As Single [r/o]
  • Property PointValue(ByVal x As Single, ByVal y As Single, [ByVal Interpolate As Boolean = False]) As Single [r/o]
  • Property ReferenceSystem As String [r/o]
  • Property ReferenceUnits As String [r/o]
  • Property Resolution As Single [r/o]
  • Property Rows As Long [r/o]
  • Property Specification As IRveaGridSpecification [r/o]
  • Property Units As String [r/o]
  • Function CutWindow(ByVal WindowExtent As IRveaRectangle) As IRveaRealGridMap

IRveaRealGridMapCreateable

  • Property CellValue(ByVal x As Long, ByVal y As Long) As Single [r/w]
  • Property Columns As Long [r/o]
  • Property Extent As IRveaRectangle [r/o]
  • Property FlagValue As Single [r/o]
  • Property MaximumValue([ByVal SupressReEvaluation As Boolean = False]) As Single [r/o]
  • Property MinimumValue([ByVal SupressReEvaluation As Boolean = False]) As Single [r/o]
  • Property PointValue(ByVal x As Single, ByVal y As Single, [ByVal Interpolate As Boolean = False]) As Single [r/o]
  • Property ReferenceSystem As String [r/o]
  • Property ReferenceUnits As String [r/o]
  • Property Resolution As Single [r/o]
  • Property Rows As Long [r/o]
  • Property Specification As IRveaGridSpecification [r/o]
  • Property Units As String [r/o]
  • Sub Create(ByVal Specification As IRveaGridMapSpecification, ByVal FlagValue As Single, ByVal Units As String, [ByVal ReferenceUnits As String = "metres"], [ByVal ReferenceSystem As String = "plane"])
  • Function CutWindow(ByVal WindowExtent As IRveaRectangle) As IRveaRealGridMapCreateable
  • Sub FillWithValue(ByVal Value As Single)

IRveaRectangle

  • Property Area As Single [r/o]
  • Property BottomLeft As IRveaPoint [r/o]
  • Property BottomRight As IRveaPoint [r/o]
  • Property DoesContainPoint(ByVal QueryX As Single, ByVal QueryY As Single) As Boolean [r/o]
  • Property DoesContainRectangle(ByVal QueryRectangle As IRveaRectangle) As Boolean [r/o]
  • Property DoesIntersectWithRectangle(ByVal QueryRectangle As IRveaRectangle) As Boolean [r/o]
  • Property Height As Single [r/o]
  • Property MaximumX As Single [r/o]
  • Property MaximumY As Single [r/o]
  • Property MinimumX As Single [r/o]
  • Property MinimumY As Single [r/o]
  • Property TopLeft As IRveaPoint [r/o]
  • Property TopRight As IRveaPoint [r/o]
  • Property Width As Single [r/o]

IRveaRectangleEditable

  • Property Area As Single [r/o]
  • Property AsIRveaRectangle As IRveaRectangle [r/o]
  • Property BottomLeft As IRveaPoint [r/o]
  • Property BottomRight As IRveaPoint [r/o]
  • Property DoesContainPoint(ByVal QueryX As Single, ByVal QueryY As Single) As Boolean [r/o]
  • Property DoesContainRectangle(ByVal QueryRectangle As IRveaRectangle) As Boolean [r/o]
  • Property Height As Single [r/o]
  • Property MaximumX As Single [r/o]
  • Property MaximumY As Single [r/o]
  • Property MinimumX As Single [r/o]
  • Property MinimumY As Single [r/o]
  • Property TopLeft As IRveaPoint [r/o]
  • Property TopRight As IRveaPoint [r/o]
  • Property Width As Single [r/o]
  • Sub ExtendToIncludePoint(ByVal PointX As Single, ByVal PointY As Single)
  • Sub SetCorners(ByVal FirstX As Single, ByVal FirstY As Single, ByVal SecondX As Single, ByVal SecondY As Single)

IRveaRegionalExtremeWindClimate

  • Property ExtremeWindRose As IRveaExtremeWindRose [r/o]
  • Property LatitudeDegrees As Single [r/o]
  • Property MeasurementHeightAGL As Single [r/o]
  • Property MeasurementRoughnessLength As Single [r/o]
  • Property SourceDataSouvenir As IRveaSourceDataSouvenir [r/o]

IRveaRegionalExtremeWindClimateEditable

  • Property ExtremeWindRose As IRveaExtremeWindRoseEditableLegacy [r/o]
  • Property LatitudeDegrees As Single [r/o]
  • Property MeasurementHeightAGL As Single [r/o]
  • Property MeasurementRoughnessLength As Single [r/o]
  • Property SourceDataSouvenir As IRveaSourceDataSouvenirEditable [r/o]

IRveaRoseSector

  • Property CentreAngle As IRveaAngle [r/o]
  • Property EndAngle As IRveaAngle [r/o]
  • Property SectorWidth As IRveaAngle [r/o]
  • Property StartAngle As IRveaAngle [r/o]

IRveaRoseStructureDefinition

  • Property CountOfSectors As Long [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]

IRveaRoseStructureDefinitionEditable

  • Property CountOfSectors As Long [r/w]
  • Property SectorOneCentreAngleDegrees As Single [r/w]

IRveaRoughnessRose

  • Property CountOfSectors As Long [r/o]
  • Property FarthestChangeRadius As Single [r/o]
  • Property SectorForAngleDegrees(ByVal Angle As Single) As IRveaRoughnessRoseSector [r/o]
  • Property SectorForIndex(ByVal SectorIndex As Long) As IRveaRoughnessRoseSector [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property SectorWithFarthestZoneExtent As IRveaRoughnessRoseSector [r/o]

IRveaRoughnessRoseEditable

  • Property CountOfSectors As Long [r/o]
  • Property FarthestChangeRadius As Single [r/o]
  • Property SectorForAngleDegrees(ByVal Angle As Single) As IRveaRoughnessRoseSectorEditable [r/o]
  • Property SectorForIndex(ByVal SectorIndex As Long) As IRveaRoughnessRoseSectorEditable [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property SectorWithFarthestZoneExtent As IRveaRoughnessRoseSectorEditable [r/o]

IRveaRoughnessRoseSector

  • Property CountOfZones As Long [r/o]
  • Property FarthestZone As IRveaRoughnessRoseSectorZone [r/o]
  • Property NearestZone As IRveaRoughnessRoseSectorZone [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property ZoneByIndex(ByVal ZoneIndex As Long) As IRveaRoughnessRoseSectorZone [r/o]
  • Property ZoneByRadius(ByVal Radius As Single) As IRveaRoughnessRoseSectorZone [r/o]

IRveaRoughnessRoseSectorEditable

  • Property CountOfZones As Long [r/o]
  • Property FarthestZone As IRveaRoughnessRoseSectorZoneEditable [r/o]
  • Property NearestZone As IRveaRoughnessRoseSectorZoneEditable [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property ZoneByIndex(ByVal ZoneIndex As Long) As IRveaRoughnessRoseSectorZoneEditable [r/o]
  • Property ZoneByRadius(ByVal Radiys As Single) As IRveaRoughnessRoseSectorZoneEditable [r/o]
  • Function InsertZone(ByVal NearestRadius As Single, ByVal RoughnessLength As Single) As IRveaRoughnessRoseSectorZoneEditable
  • Sub RemoveZoneByIndex(ByVal ZoneIndex As Long)
  • Sub RemoveZoneByReference(ByVal Zone As IRveaRoughnessRoseSectorZone)

IRveaRoughnessRoseSectorZone

  • Property FarthestRadius As Single [r/o]
  • Property NearestRadius As Single [r/o]
  • Property OwningSector As IRveaRoughnessRoseSector [r/o]
  • Property RadialWidth As Single [r/o]
  • Property RoughnessLength As Single [r/o]
  • Property SurfaceLandFraction As Single [r/o]

IRveaRoughnessRoseSectorZoneEditable

  • Property FarthestRadius As Single [r/o]
  • Property NearestRadius As Single [r/w]
  • Property OwningSector As IRveaProductionRoseSectorEditable [r/o]
  • Property RadialWidth As Single [r/o]
  • Property RoughnessLength As Single [r/w]
  • Property SurfaceLandFraction As Single [r/w]

IRveaSessionEditable

  • Property IsEditSessionUnderway As Boolean [r/o]
  • Function EndEditingSession(ByVal SessionKey As String) As Boolean
  • Function StartEditingSession() As String

IRveaSimpleProductionDistribution

  • Property AnnualProduction As Single [r/o]
  • Property ProductionForSpeed(ByVal Speed As Single) As Single [r/o]

IRveaSimpleSpeedProbabilityDistribution

  • Property MeanSpeed As Single [r/o]
  • Property PowerDensityForSpeed(ByVal Speed As Single, [ByVal AirDensity As Single = 0]) As Single [r/o]
  • Property ProbabilityOfSpeed(ByVal Speed As Single) As Single [r/o]
  • Property TotalPowerDensity([ByVal AirDensity As Single = 0]) As Single [r/o]

IRveaSite

  • Property Description As String [r/o]
  • Property Elevation As Single [r/o]
  • Property IsLocated As Boolean [r/o]
  • Property Location As IRveaPoint [r/o]
  • Property LocationX As Single [r/o]
  • Property LocationY As Single [r/o]

IRveaSiteEditable

  • Property Description As String [r/w]
  • Property Elevation As Single [r/o]
  • Property IsLocated As Boolean [r/o]
  • Property Location As IRveaPoint [r/o]
  • Property LocationX As Single [r/o]
  • Property LocationY As Single [r/o]
  • Sub Move(ByVal NewX As Single, ByVal NewY As Single)

IRveaSourceDataSouvenir

  • Property DurationYears As Single [r/o]
  • Property RecordingIntervalSeconds As Single [r/o]
  • Property SamplingPeriodSeconds As Single [r/o]

IRveaSourceDataSouvenirEditable

  • Property DurationYears As Single [r/w]
  • Property RecordingIntervalSeconds As Single [r/w]
  • Property SamplingPeriodSeconds As Single [r/w]

IRveaTimeRange

  • Property Duration As Double [r/o]
  • Property EndTime As Double [r/o]
  • Property StartTime As Double [r/o]
  • Function DoesIncludeTime(ByVal TimeStamp As Double) As Boolean
  • Function IsEqualTo(ByVal ComparingTimeRange As IRveaTimeRange) As Boolean

IRveaTurbulenceDistribution

  • Property CountOfPoints As Long [r/o]
  • Property PointForIndex(ByVal Index As Long) As IRveaTurbulenceDistributionDataPoint [r/o]
  • Property PointNearestToSpeed(ByVal Speed As Single) As IRveaTurbulenceDistributionDataPoint [r/o]
  • Property PointWithHighestTurbulence As IRveaTurbulenceDistributionDataPoint [r/o]
  • Function ReadOffTurbulenceIntensityValueForSpeed(ByVal Speed As Single) As Single

IRveaTurbulenceDistributionDataPoint

  • Property Speed As Single [r/o]
  • Property TurbulenceIntensity As Single [r/o]

IRveaTurbulenceDistributionEditable

  • Property CountOfPoints As Long [r/o]
  • Property PointForIndex(ByVal Index As Long) As IRveaTurbulenceDistributionDataPoint [r/o]
  • Property PointNearestToSpeed(ByVal Speed As Single) As IRveaTurbulenceDistributionDataPoint [r/o]
  • Property PointWithHighestTurbulence As IRveaTurbulenceDistributionDataPoint [r/o]
  • Function AddPoint(ByVal Speed As Single, ByVal TurbulenceIntensity As Single) As IRveaTurbulenceDistributionDataPoint
  • Function ReadOffTurbulenceIntensityValueForSpeed(ByVal Speed As Single) As Single

IRveaTurbulenceRose

  • Property CountOfSectors As Long [r/o]
  • Property SectorForAngleDegrees(ByVal Angle As Single) As IRveaTurbulenceRoseSector [r/o]
  • Property SectorForIndex(ByVal Index As Long) As IRveaTurbulenceRoseSector [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property SectorWithHighestSpeed As IRveaTurbulenceRoseSector [r/o]
  • Property SectorWithHighestTurbulenceIntensity As IRveaTurbulenceRoseSector [r/o]
  • Property SpectrumType As eTurbulenceSpectrumType [r/o]
  • Property VelocityComponent As eWindVelocityComponent [r/o]

IRveaTurbulenceRoseEditable

  • Property CountOfSectors As Long [r/o]
  • Property SectorForAngleDegrees(ByVal Angle As Single) As IRveaTurbulenceRoseSectorEditable [r/o]
  • Property SectorForIndex(ByVal Index As Long) As IRveaTurbulenceRoseSectorEditable [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property SectorWithHighestSpeed As IRveaTurbulenceRoseSectorEditable [r/o]
  • Property SectorWithHighestTurbulenceIntensity As IRveaTurbulenceRoseSectorEditable [r/o]
  • Property SpectrumType As eTurbulenceSpectrumType [r/o]
  • Property VelocityComponent As eWindVelocityComponent [r/o]

IRveaTurbulenceRoseSector

  • Property Distribution As IRveaTurbulenceDistribution [r/o]
  • Property Sector As IRveaRoseSector [r/o]

IRveaTurbulenceRoseSectorEditable

  • Property Distribution As IRveaTurbulenceDistributionEditable [r/o]
  • Property Sector As IRveaRoseSector [r/o]

IRveaUpwindVelocityDerivatives

  • Property BackgroundWindFrictionVelocity As Single [r/o]
  • Property BackgroundWindRoughnessLength As Single [r/o]
  • Property NumberOfUpwindPoints As Long [r/o]
  • Property SiteWindDirection As Single [r/o]
  • Property UpwindPointData(ByVal PointIndex As Long) As RveaUpwindPointData [r/o]
  • Property WindDirection As Single [r/o]
  • Property WindHeight As Single [r/o]
  • Property WindSpeed As Single [r/o]

IRveaVectorMap

  • Property AllLines As IRveaPolyLineSet [r/o]
  • Property BoundaryLines As IRveaPolyLineSet [r/o]
  • Property ElevationLines As IRveaPolyLineSet [r/o]
  • Property Extent As IRveaRectangle [r/o]
  • Property RoughnessChangeLines As IRveaPolyLineSet [r/o]
  • Function CalculateElevation(ByVal QueryX As Single, ByVal QueryY As Single) As Single
  • Function CalculateRoughness(ByVal QQueryX As Single, ByVal QueryY As Single) As Single
  • Function CutWindow(ByVal WindowExtent As IRveaRectangle) As IRveaVectorMap

IRveaWeibullDistribution

  • Property CumulativeProbabilityOfSpeed(ByVal Speed As Single) As Single [r/o]
  • Property MaximumFrequency As Single [r/o]
  • Property MaximumPowerDensity([ByVal AirDensity As Single = 0]) As Single [r/o]
  • Property MeanSpeed As Single [r/o]
  • Property MedianSpeed As Single [r/o]
  • Property ModalSpeed As Single [r/o]
  • Property Moment(ByVal Index As Long) As Single [r/o]
  • Property PowerDensityForSpeed(ByVal Speed As Single, [ByVal AirDensity As Single = 0]) As Single [r/o]
  • Property ProbabilityOfSpeed(ByVal Speed As Single) As Single [r/o]
  • Property SpeedOfMaximumFrequency As Single [r/o]
  • Property SpeedOfMaximumPowerDensity As Single [r/o]
  • Property TotalPowerDensity([ByVal AirDensity As Single = 0]) As Single [r/o]
  • Property Variance As Single [r/o]
  • Property WeibullA As Single [r/o]
  • Property WeibullK As Single [r/o]

IRveaWeibullDistributionEditable

  • Property CumulativeProbabilityOfSpeed(ByVal Speed As Single) As Single [r/o]
  • Property MaximumFrequency As Single [r/o]
  • Property MaximumPowerDensity([ByVal AirDensity As Single = 0]) As Single [r/o]
  • Property MeanSpeed As Single [r/o]
  • Property MedianSpeed As Single [r/o]
  • Property ModalSpeed As Single [r/o]
  • Property Moment(ByVal Index As Long) As Single [r/o]
  • Property PowerDensityForSpeed(ByVal Speed As Single, [ByVal AirDensity As Single = 0]) As Single [r/o]
  • Property ProbabilityOfSpeed(ByVal Speed As Single) As Single [r/o]
  • Property SpeedOfMaximumFrequency As Single [r/o]
  • Property SpeedOfMaximumPowerDensity As Single [r/o]
  • Property TotalPowerDensity([ByVal AirDensity As Single = 0]) As Single [r/o]
  • Property Variance As Single [r/o]
  • Property WeibullA As Single [r/o]
  • Property WeibullK As Single [r/o]
  • Sub Edit(ByVal NewWeibullA As Single, ByVal NewWeibullK As Single)

IRveaWeibullWind

  • Property Sector As IRveaRoseSector [r/o]
  • Property SectorFrequency As Single [r/o]
  • Property WeibullDistribution As IRveaWeibullDistribution [r/o]

IRveaWeibullWindEditable

  • Property Sector As IRveaRoseSector [r/o]
  • Property SectorFrequency As Single [r/w]
  • Property WeibullDistribution As IRveaWeibullDistributionEditable [r/o]
  • Function SetupWeibullDistribution(ByVal WeibullA As Single, ByVal WeibullK As Single) As IRveaWeibullDistributionEditable

IRveaWeibullWindRose

  • Property CountOfSectors As Long [r/o]
  • Property EmergentProbabilityDistribution As IRveaSimpleSpeedProbabilityDistribution [r/o]
  • Property OmniDirectionalDistribution As IRveaWeibullDistribution [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindForAngleDegrees(ByVal Angle As Single) As IRveaWeibullWind [r/o]
  • Property WindForSectorIndex(ByVal SectorIndex As Long) As IRveaWeibullWind [r/o]
  • Property WindWithHighestDistributionFrequency As IRveaWeibullWind [r/o]
  • Property WindWithHighestPowerDensity As IRveaWeibullWind [r/o]
  • Property WindWithHighestSectorFrequency As IRveaWeibullWind [r/o]

IRveaWeibullWindRoseEditable

  • Property CountOfSectors As Long [r/o]
  • Property EmergentProbabilityDistribution As IRveaSimpleSpeedProbabilityDistribution [r/o]
  • Property OmniDirectionalDistribution As IRveaWeibullDistribution [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindForAngleDegrees(ByVal Angle As Single) As IRveaWeibullWindEditable [r/o]
  • Property WindForSectorIndex(ByVal SectorIndex As Long) As IRveaWeibullWindEditable [r/o]
  • Property WindWithHighestDistributionFrequency As IRveaWeibullWindEditable [r/o]
  • Property WindWithHighestPowerDensity As IRveaWeibullWindEditable [r/o]
  • Property WindWithHighestSectorFrequency As IRveaWeibullWindEditable [r/o]

IRveaWindAtlas

  • Property CountOfReferenceHeights As Long [r/o]
  • Property CountOfReferenceRoughnessLengths As Long [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property Description As String [r/o]
  • Property ReferenceHeight(ByVal HeightIndex As Long) As Single [r/o]
  • Property ReferenceRoughnessLength(ByVal RoughnessLengthIndex As Long) As Single [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WeibullWindRose(ByVal RoughnessLengthIndex As Long, ByVal HeightIndex As Long) As IRveaWeibullWindRose [r/o]

IRveaWindAtlasEditable

  • Property CountOfReferenceHeights As Long [r/o]
  • Property CountOfReferenceRoughnessLengths As Long [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property Description As String [r/w]
  • Property ReferenceHeight(ByVal HeightIndex As Long) As Single [r/w]
  • Property ReferenceRoughnessLength(ByVal RoughnessLengthIndex As Long) As Single [r/w]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WeibullWindRose(ByVal RoughnessLengthIndex As Long, ByVal HeightIndex As Long) As IRveaWeibullWindRoseEditable [r/o]

IRveaWindCorrection

  • Property DirectionDeflectionDegrees As Single [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property SpeedMultiplier As Single [r/o]

IRveaWindCorrectionEditable

  • Property DirectionDeflectionDegrees As Single [r/w]
  • Property Sector As IRveaRoseSector [r/o]
  • Property SpeedMultiplier As Single [r/w]

IRveaWindCorrectionRose

  • Property CountOfSectors As Long [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindCorrectionForAngleDegrees(ByVal Angle As Single) As IRveaWindCorrection [r/o]
  • Property WindCorrectionForSectorIndex(ByVal SectorIndex As Long) As IRveaWindCorrection [r/o]

IRveaWindCorrectionRoseEditable

  • Property CountOfSectors As Long [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindCorrectionForAngleDegrees(ByVal Angle As Single) As IRveaWindCorrectionEditable [r/o]
  • Property WindCorrectionForSectorIndex(ByVal SectorIndex As Long) As IRveaWindCorrectionEditable [r/o]

IRveaWindTurbineGenerator

  • Property Comments As String [r/o]
  • Property CountOfDefaultHeights As Long [r/o]
  • Property CountOfPerformanceTables As Long [r/o]
  • Property DefaultHeight([ByVal Index As Long = 0]) As Single [r/o]
  • Property Description As String [r/o]
  • Property ManufacturerName As String [r/o]
  • Property PerformanceTable(ByVal Index As Long) As IRveaWtgPerformanceTable [r/o]
  • Property ReferenceURI As String [r/o]
  • Property RotorDiameter As Single [r/o]

IRveaWindTurbineGeneratorEditable

  • Property Comments As String [r/w]
  • Property CountOfDefaultHeights As Long [r/o]
  • Property CountOfPerformanceTables As Long [r/o]
  • Property DefaultHeight(ByVal Index As Long) As Single [r/o]
  • Property Description As String [r/w]
  • Property ManufacturerName As String [r/w]
  • Property PerformanceTable(ByVal Index As Long) As IRveaWtgPerformanceTableEditable [r/o]
  • Property ReferenceURI As String [r/w]
  • Property RotorDiameter As Single [r/w]
  • Sub AddDefaultHeight(ByVal Height As Single)
  • Function AddPerformanceTable() As IRveaWtgPerformanceTableEditable
  • Sub RemoveDefaultHeight(ByVal Index As Long)
  • Sub RemovePerformanceTableByIndex(ByVal Index As Long)
  • Sub RemovePerformanceTableByReference(ByVal TargetTable As IRveaWtgPerformanceTableEditable)

IRveaWtgPerformanceTable

  • Property AirDensity As Single [r/o]
  • Property BladePitchAngle As Single [r/o]
  • Property Comments As String [r/o]
  • Property CountOfDataPoints As Long [r/o]
  • Property DataSource As String [r/o]
  • Property DataStatus As String [r/o]
  • Property HigherSpeedLimit As Single [r/o]
  • Property HighSpeedCutInSpeed As Single [r/o]
  • Property HighSpeedCutOutSpeed As Single [r/o]
  • Property LowerSpeedLimit As Single [r/o]
  • Property LowSpeedCutInSpeed As Single [r/o]
  • Property LowSpeedCutOutSpeed As Single [r/o]
  • Property MaximumNoiseLevel As Single [r/o]
  • Property NearestPointForSpeed(ByVal Speed As Single) As IRveaWtgPerformanceTableDataPoint [r/o]
  • Property NonRotatingThrustCoEfficient As Single [r/o]
  • Property PointByIndex(ByVal Index As Long) As IRveaWtgPerformanceTableDataPoint [r/o]
  • Property PointWithHighestPower As IRveaWtgPerformanceTableDataPoint [r/o]
  • Property PointWithHighestThrust As IRveaWtgPerformanceTableDataPoint [r/o]
  • Property ReadOffPowerForSpeed(ByVal Speed As Single) As Single [r/o]
  • Property ReadOffThrustForSpeed(ByVal Speed As Single) As Single [r/o]
  • Property ReferenceURI As String [r/o]
  • Property ReleaseDate As Date [r/o]
  • Property RotationRate As Single [r/o]

IRveaWtgPerformanceTableDataPoint

  • Property Power As Single [r/o]
  • Property Speed As Single [r/o]
  • Property Thrust As Single [r/o]

IRveaWtgPerformanceTableEditable

  • Property AirDensity As Single [r/w]
  • Property BladePitchAngle As Single [r/w]
  • Property Comments As String [r/w]
  • Property CountOfDataPoints As Long [r/o]
  • Property DataSource As String [r/w]
  • Property DataStatus As String [r/w]
  • Property HigherSpeedLimit As Single [r/o]
  • Property HighSpeedCutInSpeed As Single [r/o]
  • Property HighSpeedCutOutSpeed As Single [r/o]
  • Property LowerSpeedLimit As Single [r/o]
  • Property LowSpeedCutInSpeed As Single [r/o]
  • Property LowSpeedCutOutSpeed As Single [r/o]
  • Property MaximumNoiseLevel As Single [r/w]
  • Property NonRotatingThrustCoEfficient As Single [r/w]
  • Property PointByIndex(ByVal Index As Long) As IRveaWtgPerformanceTableDataPoint [r/o]
  • Property PointWithHighestPower As IRveaWtgPerformanceTableDataPoint [r/o]
  • Property PointWithHighestThrust As IRveaWtgPerformanceTableDataPoint [r/o]
  • Property ReadOffPowerForSpeed(ByVal Speed As Single) As Single [r/o]
  • Property ReadOffThrustForSpeed(ByVal Speed As Single) As Single [r/o]
  • Property ReferenceURI As String [r/w]
  • Property ReleaseDate As Date [r/w]
  • Property RotationRate As Single [r/w]
  • Sub AppendDataPoint(ByVal Speed As Single, ByVal Power As Single, ByVal Thrust As Single)
  • Sub SetupSpeedLimitStrategy(ByVal LowSpeedCutIn As Single, ByVal LowSpeedCutOut As Single, ByVal HighSpeedCutIn As Single, ByVal HighSpeedCutOut As Single)

IRveaXMLFilter

  • Property CountOfExtensions As Long [r/o]
  • Property Description As String [r/o]
  • Property DocType As String [r/o]
  • Property Extension(ByVal ExtensionIndex As Long) As String [r/o]
  • Function ProvideDTD() As String

Enum eEngineeringWindType

  • EWT_Geostrophic As Long=1
  • EWT_ReducedGeostrophic As Long=2
  • EWT_Measured As Long=3

Enum eLatLongDegreeDecimalFractionSelector

  • eLlddfsDegrees As Long=1
  • eLlddfsMinutes As Long=2
  • eLlddfsSeconds As Long=3

Enum eNamedObservationSeriesFieldID

  • enosfTurbulenceIntensity As Long=7
  • enosfStandardDeviationWindSpeed As Long=6
  • enosfMinimumWindSpeed As Long=5
  • enosfUndefined As Long=0
  • enosfMeanWindSpeed As Long=1
  • enosfMeanWindDirection As Long=2
  • enosfMeanAirTemperature As Long=3
  • empsfMaximumWindSpeed As Long=4

Enum eSiteType

  • estUndefined As Long=0
  • estTurbineSite As Long=1
  • estMetStation As Long=2

Enum eTurbineTypeDataCurveDataStatus

  • ettdcdsUnknown As Long=0
  • ettdcdsEstimated As Long=1
  • ettdcdsProvisional As Long=2
  • ettdcdsTest As Long=3
  • ettdcdsApproved As Long=4

Enum eTurbulenceSpectrumType

  • tstSimuiScanlan As Long=1
  • tstKWIC As Long=0
  • tstESDU As Long=2

Enum eWindVelocityComponent

  • evcU As Long=0
  • evcW As Long=1
  • evcV As Long=2

Type RveaLinePoint

  • x As Single
  • y As Single

Type RveaMapCoordinate

  • x As Double
  • y As Double

Type RveaUpwindPointData

  • x As Single
  • y As Single
  • H As Single
  • Z As Single
  • U As Single
  • V As Single
  • W As Single
  • dUdxn As Single
  • dUdyn As Single
  • dUdzn As Single
  • dVdxn As Single
  • dVdyn As Single
  • dVdzn As Single
  • dWdxn As Single
  • dWdyn As Single
  • dWdzn As Single
  • dUdxr As Single
  • dUdyr As Single
  • dUdzr As Single
  • dVdxr As Single
  • dVdyr As Single
  • dVdzr As Single
  • dWdxr As Single
  • dWdyr As Single
  • dWdzr As Single


Acknowlegements

The front page picture: `Scriptorium Monk at Work' used by permission of Liam Quin, http://fromoldbooks.org/Blades-Pentateuch/


Scripting in WAsP

This documentation emphasises the use of scripting for generating reports.


How to start

Getting started

Scripts are made available to the user in the WAsP program when they are placed in the scripts folder. Some scripts are distributed with the WAsP installation, these are contained in a archive ('zip') file. Individual script files which are located in the same folder are also recognised, these are known as custom scripts. See this section for more information: How WAsP finds and uses scripts.

What do you want to do?

Make a minor change to an existing script

  • Open the 'Wasp 10 standard scripts.zip' archive file.
  • Extract the script you would like to edit to the scripts folder.
  • Read the following help section: Anatomy of a script file
  • Open the script file in a text editor. You might want to change the Description attribute to show that the script is edited
  • Identify the CDATA block which contains the actual script code
  • Try to work out which part of the script has the bit you want to change
  • Use the search facility here to discover more about what you want to edit
  • Make the change
  • You could insert some message box debugging hints around your edit
  • Save the script file
  • Run the script from within WAsP. The program will read the new version.

Make a new report script

  • Make a new file with the relevant XML container code (you can copy the XML from another script, or use a template)
  • Save it to the right folder for WAsP to find it.
  • Put some trivial information inside the CDATA block , such as a message box
  • Save the script file
  • Restart WAsP, and check that the script appears in the 'Reports' menu.
  • Run the script
  • Read about the object model, and look for examples in existing scripts which do what you want
  • Insert the new functions, one at a time, and test each time
  • When you're happy, just strip out the debugging message boxes


Anatomy of a script file

The script file

Each script is saved in its own file. WAsP 10 script files have the extension *.was9. They are ASCII files, so you can just open them in Notepad or Internet Explorer to look at their contents.

The files themselves are written in XML, but contain a CDATA block which represents the actual script code. The XML is just used to provide meta-data: a context within which the script itself can be interpreted.

The CDATA block of actual script code should begin with a Sub Main() statement. The GUI executes each script by loading in the code and calling Main.

The XML

There is an XML schema for the script files, which defines precisely what the files can contain. The schema is documented here. It can be used to validate edited scripts, but of course it will not be able to check the contents of the code itself which is embedded in the CDATA block.

The <RveaWaspInternalScript> element

The script file's top level element is called <RveaWaspInternalScript>, it has four attributes.

Three are to do with the format version of the script. These attributes are needed so that if we change the format in future, the program can continue to work with older ones. If you are making a new script, then you should set the CurrentApplicationVersion to the version of WAsP which you can discover from the About box on the Help menu. Make sure that you use the correct format XX.XX.XXXX. If in doubt, set the MinimumApplicationVersion to the same value as the CurrentApplicationVersion.

The fourth attribute, 'Description', is the name of the script as it will appear in the script menu in the main program.

The <ScriptType> element

The script can only be of one type, which (at the time of writing) is constrained to be one of the following:

  • Report
  • Utility

The script output type is determined by the attribute 'OutputType'. WAsP uses this attribute to try to check that you've got the right output program installed. Some of the supplied sample scripts are MS Word , so WAsP will try to raise a helpful error if Word is not installed. The GUI will not actually prevent the you from trying to run the scripts, even if it thinks that the required programs are not available.

The <RequiredProjectSelection> element(s)

Script execution is initiated from the selected hierarchy member in the project view on the left hand side of the main window.

The script XML can contain one or more declarations about what selections are required. If more than one declaration is present, the the script will be available to each hierarchy member declared.

Here is a list of the possible selections.

  • MetStation
  • Note
  • ObservedWindClimate
  • ObstacleGroup
  • Project
  • ReferenceSite
  • ResourceGrid
  • RoughnessRose
  • SpatialImage
  • TurbineSite
  • TurbineSiteGroup
  • VectorMap
  • WindAtlas
  • WindTurbineGenerator
  • Workspace

The <ScriptCode> element

This contains the script code itself, in a CDATA block.

Another document describes the contents of this block.


Script template

An empty script template

You can use this template to set up a new script. Copy the whole lot and paste it into an empty text file. Save with a *.was9 extension to the appropriate folder.

You will need to edit the template before it's OK. For more guidance, see the anatomy of a script section. To check that it's correctly formatted, you can use the schema.

<RveaWaspInternalScript
MinimumApplicationVersion="09.01.0001"
CurrentApplicationVersion="10.0.27"
FormatVersion="01.01.0001"
Description="[Some description here]"
ScriptVersion="[Script version here]">

<ScriptType OutputType="[OutputType]">[ScriptType]</ScriptType>

<RequiredProjectSelection>[Member]</RequiredProjectSelection>
<RequiredProjectSelection>[Member]</RequiredProjectSelection>
...
<RequiredProjectSelection>[Member]</RequiredProjectSelection>

<ScriptCode><![CDATA[

Sub Main()

End Sub

]]></ScriptCode>

</RveaWaspInternalScript>

ScriptType element

There must be only one ScriptType element.

[OutputType] can be one of the following values:

  • HTML
  • Excel
  • Word
  • XML
  • None

[ScriptType] can be one of the following values:

  • Report
  • Utility

RequiredProjectSelection element

At least one RequiredProjectSelection element must be present. This element represents the hierarchy member which the script will be available to. If there are multiple RequiredProjectSelection elements, the script will be available to each of the hierarchy members specified.

[HierarchyMember] can be one of the following:

  • MetStation
  • Note
  • ObservedWindClimate
  • ObstacleGroup
  • Project
  • ReferenceSite
  • ResourceGrid
  • RoughnessRose
  • SpatialImage
  • TurbineSite
  • TurbineSiteGroup
  • VectorMap
  • WindAtlas
  • WindTurbineGenerator
  • Workspace


How WAsP finds and uses the script files

Distributed scripts

Scripts distributed with the WAsP installation are contained in the 'Wasp 10 standard scripts.zip' archive.

Custom scripts

Custom scripts reside in the same folder as the distributed scripts archive. Custom scripts do not need to be contained within a zip file. The structure of custom scripts is identical to distributed scripts.

Which folder is used

WAsP uses the 'Scripts path' setting to determine where it looks for scripts. The default value for this setting is:

    c:\Program Files\Wasp\Internal scripts\Wasp

This setting can be changed in the Options window of the GUI program:

    WAsP -> Options -> Reports -> (Root) path for report and utility scripts

New script - restart required

If a new custom script is added to the scripts folder while WAsP is running, a restart will be required before the script is made available from within WAsP.

Edit script- no restart required

WAsP will always operate on the latest version of a script so editing an existing custom script will have immediate effect without needing to restart WAsP.

When WAsP finds scripts

The WAsP GUI compiles a list of scripts when the program starts. This list is available from the main 'Reports' menu, and also as a right-click context menu for each hierarchy member. The distributed scripts are listed first, followed by any custom scripts (which are marked with a different icon).

Script extension *.was9

Scripts for WAsP 9.0 and later have a *.was9 extension. Older scripts with *.was extension will no longer work in WAsP 10 and will need to be upgraded manually.

Different extensions: *.wes and *.wes2

These extensions belong to script files for the WAsP Engineering program and will be ignored by WAsP. They may be found in subfolders of the 'Internal scripts' folder if you have WAsP Engineering installed alongside WAsP.

When WAsP reads the scripts' contents

WAsP reads the script contents every time they are needed. So, editing and saving a script (to the same file name) will cause the new version to be used immediately. There is no need to re-start the program. This makes it a bit quicker to test and debug scripts.

Only the script files found when WAsP starts will be listed, so if you add a new custom script while WAsP is running then the program will need restarting to see the new script in the reports menu. Remember to save the workspace before restarting.


Script execution context

When a script runs inside WAsP, the GUI sets things up so that the script can retrieve information about what's happening in the program.

Scritps are designed to run in the context of the selected hierarchy member. Only scripts available to that member are available for selection.

Just before a script is executed, the WAsP GUI program inserts number of objects into the script's scope. When the script runs, it can just reference these objects directly.

The selection context

The currently selected hierarchy member is available in a scripting context using the SelectedHierarchyMember property provided by the WaspReportingAssistant. The following code can be used to get the selected hierarchy member:

Set Member = ReportingAssistant.SelectedHierarchyMember

Other context objects

There is also a context object called CurrentWorkspace which is available to all scripts. It has type IWaspWorkspace. This is the only WAsP hierarchy member that is available as a context object, other members need to be accessed via either the selection context as described above, or via hierarchy member traversal.

Type casting

The WaspReportingAssistant also provides a type caster which allows you type cast an object to another interface. The following code can be used to get the selected hierarchy member and type cast it to the ITurbineSite interface:

Set Member = ReportingAssistant.SelectedHierarchyMember
Set Site = ReportingAssistant.TypeCaster.CastMemberToTurbineSite(Member)


Type casting

The problem with interface casting

Type casting interfaces is a problem in scripts. Because the variables are untyped, you cannot make an implicit type cast and the language does not support explicit type casts. If you have an object variable (more properly described in COM as interface pointer), which has been assigned to a particular type of interface, then it cannot subsequently be assigned to another one.

For example, if you have a variable called 'Foo', and you make the following assignment ...

Set Foo = ReportingAssistant.SelectedHierarchyMember

... then Foo will be a pointer to an IHierarchyMember. Even though we know that the object returned by ReportingAssistant.SelectedHierarchyMember also implements other interfaces (for example if our selected hierarchy member was a vector map then it would also implement the IVectorMap interface) there is no immediate way to get access to those other interfaces.

In VB, or VBA, you could do an implicit typecast, like this ...

Dim Bar as IVectorMap

... then you could use Bar to access the methods from the IVectorMap interface. But you can't do that in VBScript.

In .NET and other more complete OO languages, you could make an explicit typecast, like this ...

Set Bar = CType(Foo, IVectorMap)

... but you can't do that in VBScript either.

The solutions

There are two ways to get round this problem: 'built-in' typecasting methods, and external type casting methods.

Built-in methods

Explict typecast methods can be added to some of the interfaces. This is generally useful for normal coding, but is only used when the relationship between the interfaces is well known and the need to make the type cast arises often. For example, the ITurbineSite interface has a property called AsICalculatingHierarchyMember, which returns a pointer to an ICalculatingHierarchyMember interface. So, if you've got a variable of type ITurbineSite, then you know for sure that it implements the ICalculatingHierarchyMember interface, and you can access the methods of the ICalculatingHierarchyMember interface by using the typecast property, or by setting a new variable to that interface. Here's an example:

Set CalculatingMember = TurbineSite.AsICalculatingHierarchyMember
Msgbox CalculatingMember.CalculationByIndex(1).AreResultsDirty

Note that this only works correctly if you have not previously used the CalculatingMember variable for any other type of object. The type of a variable is determined the first time it's assigned to something, and stays the same thereafter.

External methods

The second approach is externally to provide some specific methods which can be invoked to make an explicit type cast. This has the advantage of allowing the code to type cast to a more specific type (for example from a IHierarchyMember to an IVectorMap). The 'built-in' type caster methods described above can only go from a more specific to a less specific type. There's an object available to the scripts which provides a collection of such methods, called the TypeCaster.

The TypeCaster object methods

The globally available ReportingAssistant, part of the script execution context, provides access to the TypeCaster object. The scripts can just make an immediate reference to ReportingAssistant.TypeCaster, without having to create it explicitly.

Here is a list of the the publicly-available methods offered by the TypeCaster:

  • Function CastMemberToNote(ByVal Member As IHierarchyMember) As INote
  • Function CastMemberToResourceGrid(ByVal Member As IHierarchyMember) As IResourceGrid
  • Function CastMemberToUnstructuredTurbineSiteGroup(ByVal Member As IHierarchyMember) As IUnstructuredTurbineSiteGroup
  • Function CastMemberToWindTurbineGenerator(ByVal Member As IHierarchyMember) As IWindTurbineGenerator
  • Function CastMemberToTurbineSite(ByVal Member As IHierarchyMember) As ITurbineSite
  • Function CastMemberToObstacleGroup(ByVal Member As IHierarchyMember) As IObstacleGroup
  • Function CastMemberToWorkspace(ByVal Member As IHierarchyMember) As IWaspWorkspace
  • Function CastMemberToObservedWindClimate(ByVal Member As IHierarchyMember) As IObservedWindClimate
  • Function CastMemberToMetStation(ByVal Member As IHierarchyMember) As IMetStation
  • Function CastMemberToReferenceSite(ByVal Member As IHierarchyMember) As IReferenceSite
  • Function CastMemberToRoughnessRose(ByVal Member As IHierarchyMember) As IRoughnessRose
  • Function CastMemberToWindAtlas(ByVal Member As IHierarchyMember) As IWindAtlas
  • Function CastMemberToVectorMap(ByVal Member As IHierarchyMember) As IVectorMap
  • Function CastMemberToWaspSite(ByVal Member As IHierarchyMember) As IWaspSite
  • Function CastMemberToMappableHierarchyMember(ByVal Member As IHierarchyMember) As IMappableHierarchyMember
  • Function CastMemberToImportedHierarchyMember(ByVal Member As IHierarchyMember) As IImportedHierarchyMember
  • Function CastMemberToWindFarm(ByVal Member As IHierarchyMember) As IWindFarm
  • Function CastMemberToExportableHierarchyMember(ByVal Member As IHierarchyMember) As IExportableHierarchyMember
  • Function CastMemberToCalculatingHierarchyMember(ByVal Member As IHierarchyMember) As ICalculatingHierarchyMember
  • Function CastMemberToRveaConfigurable(ByVal Member As IHierarchyMember) As IRveaConfigurable
  • Function CastMemberToPreservableObject(ByVal Member As IHierarchyMember) As IRveaPreservableObject
  • Function CastObjectToRveaPreservableObject(ByVal SourceObject As Object) As IRveaPreservableObject
  • Function CastObjectToResourceGridResultMap(ByVal SourceObject As Object) As IResourceGridResultMap
  • Function CastMemberToPortableSiteGroupProvider(ByVal Member As IHierarchyMember) As IPortableSiteGroupProvider
  • Function CastMemberToRveaPortableSite(ByVal Member As IHierarchyMember) As IRveaPortableSite
  • Function CastRveaWeibullDistributionToRveaWeibullDistributionEditable(ByVal Distribution As IRveaWeibullDistribution) As IRveaWeibullDistributionEditable
  • Function CastObjectToRveaWindAtlas(ByVal SourceObject As Object) As IRveaWindAtlas

Using these type casting methods is straightforward.

Set Member = ReportingAssistant.SelectedHierarchyMember
Set Map = ReportingAssistant.TypeCaster.CastMemberToVectorMap(Member)

If the object passed in as the argument to the casting method is of the wrong type, then an error will be thrown and the script will terminate. In the above example, the Member object must be of type IHierarchyMember.

If the object passed in is Nothing, or is not of the correct return type, then the method returns Nothing. In the above example, if the Member object is not of type IVectorMap, then no error will be thrown, but Nothing will be returned.


Child members and associates

A script generally runs on the selected hierarchy member. There are several ways to get references to other hierarchy members associated with the selected member.

Children

All hierarchy members implement the IHierarchyMember interface. This interface gives access to the member's children as an iterator. The children can be filtered by class type (IHierarchyMemberClass) to return only members of a particular type. The ReportingAssistant.AllClasses property provides of all the available class types which can be used. The following code shows how to find all the resource grids contained within a project:

Set Project = ReportingAssistant.SelectedHierarchyMember.Project
Set Children = Project.AsIHierarchyMember.Children
Set Iterator = Children.FilterByClass(ReportingAssistant.AllClasses.ResourceGridClass)

Project

The IHierarchyMember interface also provides an explicit reference to the project that the member belongs to. The project member is the top level member for any project so all other members in the project can be found using the children iterator, as described above.

Set Member = ReportingAssistant.SelectedHierarchyMember
Set Project = Member.Project

Calculation Associates

The following members implement the ICalculationAssociate interface.

  • MetStation
  • ReferenceSite
  • ResourceGrid
  • TurbineSite
  • TurbineSiteGroup
  • WindAtlas

An explicit property for each of these members allows type casting to ICalculatingHierarchyMember which in turn provides access to the various types of calculation which are possible, and also their associated members:

Set Member = ReportingAssistant.SelectedHierarchyMember
Set MetStation = ReportingAssistant.TypeCaster.CastMemberToMetStation(Member)
Set Associates =
            MetStation.AsICalculatingHierarchyMember.CalculationByType(ectPredictedWindClimate).Associates

Set Map = Associates.VectorMap
Set Atlas = Associates.WindAtlas
Set RoughnessRose = Associates.RoughnessRose
Set Project = Associates.Project
Set OWC = Associates.ObservedWindClimate

Explicit properties

Some members such as vector maps (IVectorMap) have an explicit property which gives access to associated members. These generally are in the form of an iterator object (eg. IHierarchyMemberGroupIterator, ITurbineSiteGroupIterator). Here is an wind farm (IWindFarm) example:

Set Member = ReportingAssistant.SelectedHierarchyMember
Set WindFarm = ReportingAssistant.TypeCaster.CastMemberToWindFarm(Member)
Set AllSitesIterator = WindFarm.AllContributingSites
Set Site = ReportingAssistant.TypeCaster.CastMemberToTurbineSite(AllSitesIterator.FirstMember)

Do While Not Site Is Nothing
Msgbox Site.HubHeightAgl
Set Site = ReportingAssistant.TypeCaster.CastMemberToTurbineSite(AllSitesIterator.NextMember)
Loop


WAsP modelling interfaces in Rvea0134.tlb

These interfaces define the classes which WAsP uses to do the workspace modelling.

Most WAsP scripts will start by having a reference to the CurrentlySelectedHirarchyMember, because that's what the program end-user will have selected in the user-interface.

The CurrentlySelectedHirarchyMember is of type IHierarchyMember. That's a completely generic interface, which usually requires typecasting before you can do anything very interesting. The reporting assistant objects can help with this.

Each hierarchy member has a meta-class (HierarchyMemberClass), which can be useful for discovering more about it programmatically.

Each type of hierarchy member has a set of possible insertions: things that can be inserted as children of that member. In fact there are two sets of possible insertions: from file and as new. To add an member to the hierarchy, you need to get one of these sets of insertions, select the type of member you want and call 'Execute'.

This is a comprehensive API. The WAsP GUI doesn't do any modelling work itself. Many of the interfaces defined here are used in order to support the GUI experience, so I have split them into two groups to make it easier to find the interfaces which might be useful for scripting.

Interfaces which are probably useful for scripting:

  • IBackPrediction
  • ICalculatingHierarchyMember
  • ICalculation
  • ICalculationAssociates
  • IDeltaRixRose
  • IDeltaRixRoseSector
  • IExportableHierarchyMember
  • IHeight
  • IHeightGroup
  • IHierarchyInsertion
  • IHierarchyInsertionFromFile
  • IHierarchyInsertionNew
  • IHierarchyInsertions
  • IHierarchyInsertionsFromFile
  • IHierarchyInsertionsNew
  • IHierarchyMember
  • IHierarchyMemberClass
  • IHierarchyMemberClasses
  • IHierarchyMemberGroupIterator
  • IHierarchyMove
  • IImportedHierarchyMember
  • IMappableHierarchyMember
  • IMapProjection
  • IMapProjectionZone
  • IMetStation
  • INote
  • IObservedWindClimate
  • IObstacleGroup
  • IReferenceSite
  • IResourceGrid
  • IResourceGridCalculationResult
  • IResourceGridResultMap
  • IResourceGridResultsSet
  • IResourceGridStatistics
  • IResourceGridVariableResult
  • IRoughnessRose
  • ISiteAssessment
  • ISiteAssessmentSector
  • ITurbineSite
  • ITurbineSiteGroupIterator
  • ITurbineSiteGroupMember
  • ITurbineSiteGroupSummaryResultsDatum
  • ITurbineSiteGroupSummaryResultsSet
  • IUnstructuredTurbineSiteGroup
  • IUserCorrectionsRose
  • IVectorMap
  • IWakeDecaySettings
  • IWaspProject
  • IWaspSite
  • IWaspWorkspace
  • IWaspWorkspaceClass
  • IWindAtlas
  • IWindFarm
  • IWindFarmPowerCurve
  • IWindFarmPowerCurveSector
  • IWindTurbineGenerator

Interfaces which are mainly used by the GUI:

  • IAutoDescribingHierarchyMember
  • IAutoDescriptionCounter
  • IAutoDescriptionCounterProvider
  • IAutoDescriptionPolicy
  • IAutoDescriptionPolicyProvider
  • IAutoDescriptionRenameOperation
  • ICannotCalculateExplanation
  • IGoogleEarthDisplayInfoBag
  • IHierarchyChange
  • IHierarchyChangeCurious
  • IHierarchyChangeData
  • IHierarchyChangeGroup
  • IHierarchyChangeObserver
  • IHierarchyChangeStatus
  • IHierarchyChangeStructure
  • IHierarchyIrregularities
  • IHierarchyIrregularity
  • IIrregularityReportingHierarchyMember
  • IMaintenanceHatch
  • IPortableSiteGroupProvider
  • IPortableSiteGroupReceiver
  • IRvea0134Client
  • ISiteGroupHubHeightPolicy
  • ISourceFileTrace
  • ISourceFileTraces
  • ISpatialImage
  • ISpatialImageScalingPoint
  • ISpatialImageScalingPointSet
  • IWorkspaceChangeObserver

IAutoDescribingHierarchyMember

  • Property CurrentDescription As String [r/o]
  • Property IsDescriptionAutoGenerated As Boolean [r/o]
  • Function GenerateAutoDescription() As IAutoDescriptionRenameOperation
  • Sub MarkDescriptionAsCustom()

IAutoDescriptionCounter

  • Property DoRecycleUnusedNumbers As Boolean [r/w]
  • Property IsActive As Boolean [r/w]
  • Property NumberOfDigits As Long [r/w]
  • Property StartNumber As Long [r/w]
  • Sub Reset()

IAutoDescriptionCounterProvider

  • Property Counter([ByVal DontCreate As Boolean = False]) As IAutoDescriptionCounter [r/o]

IAutoDescriptionPolicy

  • Property DoIncludeGivenDescription As Boolean [r/w]
  • Property DoIncludeParentDescription As Boolean [r/w]
  • Property DoIncludeTypeDescription As Boolean [r/w]
  • Property DoPreserveCustomNames As Boolean [r/w]
  • Property GeneralPolicy As eAutoDescriptionGeneralPolicy [r/w]
  • Property GivenDescription As String [r/w]
  • Function Clone() As IAutoDescriptionPolicy
  • Sub CopyFrom(ByVal SourcePolicy As IAutoDescriptionPolicy)

IAutoDescriptionPolicyProvider

  • Property LocalPolicy As IAutoDescriptionPolicy [r/o]
  • Sub ClearLocalPolicy()
  • Function CreateLocalPolicy() As IAutoDescriptionPolicy

IAutoDescriptionRenameOperation

  • Property Member As IAutoDescribingHierarchyMember [r/o]
  • Property NewName As String [r/o]
  • Sub Apply()
  • Sub Undo()

IBackPrediction

  • Property ObservedWeibullRose As IRveaWeibullWindRose [r/o]
  • Property PredictedWeibullRose As IRveaWeibullWindRose [r/o]

ICalculatingHierarchyMember

  • Property CalculationByIndex(ByVal Index As Long) As ICalculation [r/o]
  • Property CalculationByType(ByVal CalculationType As eCalculationResultType) As ICalculation [r/o]
  • Property CountOfCalculations As Long [r/o]
  • Sub DoAllPossibleCalculations(ByVal DoSkipUnnecessary As Boolean)

ICalculation

  • Property AreResultsDirty As Boolean [r/o]
  • Property AreThereResults As Boolean [r/o]
  • Property Associates As ICalculationAssociates [r/o]
  • Property CalculationResultType As eCalculationResultType [r/o]
  • Property CanCalculate As Boolean [r/o]
  • Property ExplanationForCannotCalculate As ICannotCalculateExplanation [r/o]
  • Property IsActive As Boolean [r/w]
  • Property RecalculationBehaviour As eReCalculationBehaviour [r/w]
  • Property Status As eCalculationStatus [r/o]
  • Sub Calculate()

ICalculationAssociates

  • Property AllAssociates As IHierarchyMemberGroupIterator [r/o]
  • Property ObservedWindClimate As IObservedWindClimate [r/o]
  • Property ObstacleGroups As IHierarchyMemberGroupIterator [r/o]
  • Property Project As IWaspProject [r/o]
  • Property RoughnessRose As IRoughnessRose [r/o]
  • Property Site As IWaspSite [r/o]
  • Property VectorMap As IVectorMap [r/o]
  • Property WindAtlas As IWindAtlas [r/o]
  • Property WindTurbineGenerator As IWindTurbineGenerator [r/o]

ICannotCalculateExplanation

  • Property CountOfReasons As Long [r/o]
  • Property ReasonByIndex(ByVal Index As Long) As String [r/o]

IDeltaRixRose

  • Property CountOfSectors As Long [r/o]
  • Property OmniDirectionalComparisonRixValue As Single [r/o]
  • Property OmniDirectionalDeltaRixValue As Single [r/o]
  • Property OmniDirectionalSiteRixValue As Single [r/o]
  • Property SectorByIndex(ByVal SectorIndex As Long) As IDeltaRixRoseSector [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]

IDeltaRixRoseSector

  • Property ComparisonRixValue As Single [r/o]
  • Property DeltaRixValue As Single [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property SiteRixValue As Single [r/o]

IExportableHierarchyMember

  • Property IsReadyToExport As Boolean [r/o]
  • Property PreservableClass As IRveaPreservableClass [r/o]
  • Sub Export(ByVal Filename As String, [ByVal FileFilter As IRveaFileFilter = 0], [ByVal DoReassignSourceFileTrace As Boolean = False])

IGoogleEarthDisplayInfoBag

  • Sub Empty()

IHeight

  • Property Description As String [r/o]
  • Property HeightAgl As Single [r/o]

IHeightGroup

  • Property Count As Long [r/o]
  • Property HeightByIndex(ByVal Index As Long) As IHeight [r/o]

IHierarchyChange

  • Property ChangeType As eHierarchyChangeType [r/o]
  • Property OriginatingMember As IHierarchyMember [r/o]

IHierarchyChangeCurious

  • Property CuriousChangeType As eCuriousHierarchyChangeType [r/o]
  • Property OriginatingMember As IHierarchyMember [r/o]
  • Property SecondaryMember As IHierarchyMember [r/o]
  • Property TagObject As Object [r/o]

IHierarchyChangeData

  • Property CalculationResultType As eCalculationResultType [r/o]
  • Property DataChangeType As eDataHierarchyChangeType [r/o]
  • Property OriginatingMember As IHierarchyMember [r/o]

IHierarchyChangeGroup

  • Property Change(ByVal Index As Long) As IHierarchyChange [r/o]
  • Property Count As Long [r/o]
  • Property SubGroupByChangeType(ByVal ChangeType As eHierarchyChangeType) As IHierarchyChangeGroup [r/o]
  • Property SubGroupByClass(ByVal HierarchyMemberClass As IHierarchyMemberClass) As IHierarchyChangeGroup [r/o]

IHierarchyChangeObserver

  • Sub NotifyChanges(ByVal ChangeGroup As IHierarchyChangeGroup)

IHierarchyChangeStatus

  • Property Calculation As ICalculation [r/o]
  • Property NewStatus As eCalculationStatus [r/o]
  • Property OriginatingMember As IHierarchyMember [r/o]
  • Property PreviousStatus As eCalculationStatus [r/o]

IHierarchyChangeStructure

  • Property ChildMember As IHierarchyMember [r/o]
  • Property ParentMember As IHierarchyMember [r/o]
  • Property SecondaryParentMember As IHierarchyMember [r/o]
  • Property StructuralChangeType As eStructuralHierarchyChangeType [r/o]

IHierarchyInsertion

  • Property CandidateParent As IHierarchyMember [r/o]
  • Property InsertableClass As IHierarchyMemberClass [r/o]
  • Property WouldCauseReplacement As Boolean [r/o]

IHierarchyInsertionFromFile

  • Property CandidateParent As IHierarchyMember [r/o]
  • Property InsertableClass As IHierarchyMemberClass [r/o]
  • Property WouldCauseReplacement As Boolean [r/o]
  • Function Execute(ByVal Filename As String, [ByVal FileFilter As IRveaFileFilter = 0]) As IHierarchyMember

IHierarchyInsertionNew

  • Property CandidateParent As IHierarchyMember [r/o]
  • Property InsertableClass As IHierarchyMemberClass [r/o]
  • Property WouldCauseReplacement As Boolean [r/o]
  • Function Execute() As IHierarchyMember

IHierarchyInsertions

  • Property ByIndex(ByVal Index As Long) As IHierarchyInsertion [r/o]
  • Property Count As Long [r/o]
  • Property FromFile As IHierarchyInsertionsFromFile [r/o]
  • Property New As IHierarchyInsertionsNew [r/o]
  • Function FilterByClassID(ByVal ClassID As eHierarchyMemberClassID) As IHierarchyInsertions

IHierarchyInsertionsFromFile

  • Property ByClassID(ByVal ID As eHierarchyMemberClassID) As IHierarchyInsertionFromFile [r/o]
  • Property ByIndex(ByVal Index As Long) As IHierarchyInsertionFromFile [r/o]
  • Property Count As Long [r/o]

IHierarchyInsertionsNew

  • Property ByClassID(ByVal ID As eHierarchyMemberClassID) As IHierarchyInsertionNew [r/o]
  • Property ByIndex(ByVal Index As Long) As IHierarchyInsertionNew [r/o]
  • Property Count As Long [r/o]

IHierarchyIrregularities

  • Property Count As Long [r/o]
  • Property IrregularityByIndex(ByVal Index As Long) As IHierarchyIrregularity [r/o]

IHierarchyIrregularity

  • Property IrregularityType As eHierarchyIrregularityType [r/o]
  • Property PrimaryMember As IHierarchyMember [r/o]
  • Property SecondaryMembers As IHierarchyMemberGroupIterator [r/o]

IHierarchyMember

  • Property Children As IHierarchyMemberGroupIterator [r/o]
  • Property Class As IHierarchyMemberClass [r/o]
  • Property Description As String [r/w]
  • Property IdTag As String [r/o]
  • Property Insertions As IHierarchyInsertions [r/o]
  • Property Parent As IHierarchyMember [r/o]
  • Property Project As IWaspProject [r/o]
  • Function BeginMove() As IHierarchyMove
  • Sub Remove()
  • Sub SubscribeChangeObserver(ByVal Observer As IHierarchyChangeObserver)
  • Sub UnSubscribeChangeObserver(ByVal Observer As IHierarchyChangeObserver)

IHierarchyMemberClass

  • Property CanCreateFromFile As Boolean [r/o]
  • Property CanCreateNew As Boolean [r/o]
  • Property Description As String [r/o]
  • Property ID As eHierarchyMemberClassID [r/o]
  • Property Name As String [r/o]
  • Property OpeningFileFilters As IRveaFileFilters [r/o]
  • Property ShortDescription As String [r/o]

IHierarchyMemberClasses

  • Property ByDescription(ByVal Description As String) As IHierarchyMemberClass [r/o]
  • Property ByID(ByVal ID As eHierarchyMemberClassID) As IHierarchyMemberClass [r/o]
  • Property ByIndex(ByVal Index As Long) As IHierarchyMemberClass [r/o]
  • Property ByName(ByVal Name As String) As IHierarchyMemberClass [r/o]
  • Property Count As Long [r/o]
  • Property MetStationClass As IHierarchyMemberClass [r/o]
  • Property NoteClass As IHierarchyMemberClass [r/o]
  • Property ObservedWindClimateClass As IHierarchyMemberClass [r/o]
  • Property ObstacleGroupClass As IHierarchyMemberClass [r/o]
  • Property ProjectClass As IHierarchyMemberClass [r/o]
  • Property ReferenceSiteClass As IHierarchyMemberClass [r/o]
  • Property ResourceGridClass As IHierarchyMemberClass [r/o]
  • Property RoughnessRoseClass As IHierarchyMemberClass [r/o]
  • Property SpatialImageClass As IHierarchyMemberClass [r/o]
  • Property TurbineSiteClass As IHierarchyMemberClass [r/o]
  • Property TurbineSiteGroupClass As IHierarchyMemberClass [r/o]
  • Property VectorMapClass As IHierarchyMemberClass [r/o]
  • Property WindAtlasClass As IHierarchyMemberClass [r/o]
  • Property WindTurbineGeneratorClass As IHierarchyMemberClass [r/o]
  • Property WorkspaceClass As IHierarchyMemberClass [r/o]

IHierarchyMemberGroupIterator

  • Property Count As Long [r/o]
  • Property CurrentMember As IHierarchyMember [r/o]
  • Property FirstMember As IHierarchyMember [r/o]
  • Property FirstMemberByClass(ByVal SoughtClass As IHierarchyMemberClass) As IHierarchyMember [r/o]
  • Property IsLastMember As Boolean [r/o]
  • Property NextMember As IHierarchyMember [r/o]
  • Function FilterByClass(ByVal ClassToSelect As IHierarchyMemberClass) As IHierarchyMemberGroupIterator

IHierarchyMove

  • Property CandidateNewParent As IHierarchyMember [r/w]
  • Property IsMovePossible As Boolean [r/o]
  • Property MovingMember As IHierarchyMember [r/o]
  • Property OriginalParent As IHierarchyMember [r/o]
  • Property WouldCauseReplacement As Boolean [r/o]
  • Sub PerformMove()

IImportedHierarchyMember

  • Property SourceFileTrace As ISourceFileTrace [r/o]

IIrregularityReportingHierarchyMember

  • Property Irregularities As IHierarchyIrregularities [r/o]

IMaintenanceHatch

  • Function Reachin([ByVal Action1 As Variant], [ByVal Action2 As Variant]) As Variant

IMappableHierarchyMember

  • Property AssociatedMap As IVectorMap [r/o]
  • Property IsLocatedInMap As Boolean [r/o]

IMapProjection

  • Property Datum As String [r/o]
  • Property MetricProjection As String [r/o]
  • Property Zone As IMapProjectionZone [r/o]

IMapProjectionZone

  • Property Latitude As String [r/o]
  • Property Longitude As Long [r/o]

IMetStation

  • Property AnemometerHeightAgl As Single [r/w]
  • Property AsICalculatingHierarchyMember As ICalculatingHierarchyMember [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsIRveaSite As IRveaSiteEditable [r/o]
  • Property AsIWaspSite As IWaspSite [r/o]
  • Property AssociatedWindAtlas As IWindAtlas [r/o]
  • Property BackPrediction As IBackPrediction [r/o]
  • Property Description As String [r/w]

INote

  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property Contents As String [r/w]
  • Property Description As String [r/o]

IObservedWindClimate

  • Property AnemometerSiteDetails As IRveaAnemometerSiteDetails [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property GenerationSouvenir As IObservedWindClimateGenerationSouvenir [r/o]
  • Property OmniDirectionalDistribution As IRveaFrequencyDistribution [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindForAngleDegrees(ByVal Angle As Single) As IRveaObservedWind [r/o]
  • Property WindForSectorIndex(ByVal Index As Long) As IRveaObservedWind [r/o]
  • Property WindWithHighestDistributionFrequency As IRveaObservedWind [r/o]
  • Property WindWithHighestSectorFrequency As IRveaObservedWind [r/o]
  • Property WindWithHighestSpeed As IRveaObservedWind [r/o]

IObstacleGroup

  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property BoundingRectangle As IRveaRectangle [r/o]
  • Property Count As Long [r/o]
  • Property DoTryToFindLocationFromHierarchyContext As Boolean [r/w]
  • Property First As IRveaObstacleEditable [r/o]
  • Property IsLast As Boolean [r/o]
  • Property IsLocated As Boolean [r/o]
  • Property Next As IRveaObstacleEditable [r/o]
  • Property ObstaclesAtCoordinate(ByVal QueryX As Single, ByVal QueryY As Single) As IRveaObstacleGroup [r/o]
  • Property Origin As IRveaPoint [r/o]
  • Function AddObstacleByPolar(ByVal Porosity As Single, ByVal Depth As Single, ByVal Height As Single, ByVal FirstAngle As Single, ByVal FirstRadius As Single, ByVal SecondAngle As Single, ByVal SecondRadius As Single) As IRveaObstacleEditable
  • Sub MoveOrigin(ByVal NewX As Single, ByVal NewY As Single)
  • Sub RemoveObstacle(ByVal DoomedObstacle As IRveaObstacle)

IPortableSiteGroupProvider

  • Function CountOfExtractableSites() As Long
  • Function ExtractPortableSiteGroup(ByVal DoRecursively As Boolean, ByVal DoMakeFlatList As Boolean) As IRveaPortableSiteGroup

IPortableSiteGroupReceiver

  • Function CanThisGroupBeReceived(ByVal Group As IRveaPortableSiteGroup) As Boolean
  • Sub InsertPortableSiteGroup(ByVal Group As IRveaPortableSiteGroup, ByVal DefaultHeight As Single)

IReferenceSite

  • Property AsICalculatingHierarchyMember As ICalculatingHierarchyMember [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsIRveaSite As IRveaSiteEditable [r/o]
  • Property AsIWaspSite As IWaspSite [r/o]
  • Property DeltaRixRose As IDeltaRixRose [r/o]
  • Property Description As String [r/o]

IResourceGrid

  • Property AsICalculatingHierarchyMember As ICalculatingHierarchyMember [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property DoLimitNodeCoordinatesToInteger As Boolean [r/w]
  • Property GridSpecification As IRveaGridSpecification [r/o]
  • Property HubHeightAgl As Single [r/w]
  • Property IsLocatedInMap As Boolean [r/o]
  • Property Mask As IRveaRealGridMap [r/o]
  • Property Results As IResourceGridResultsSet [r/o]
  • Property UserCorrections As IUserCorrectionsRose [r/o]
  • Sub EditGridSpecification(ByVal NewSpecification As IRveaGridSpecification)
  • Sub EditMask(ByVal NewMask As IRveaRealGridMap)
  • Function GetSuggestedInitialHeights() As IHeightGroup

IResourceGridCalculationResult

  • Property CountOfResults As Long [r/o]
  • Property ResultByID(ByVal ResultMapID As eResourceGridResultMapID) As IResourceGridVariableResult [r/o]
  • Property ResultByIndex(ByVal ResultIndex As Long) As IResourceGridVariableResult [r/o]
  • Property ValidityMap As IRveaRealGridMap [r/o]

IResourceGridResultMap

  • Property Map As IRveaRealGridMap [r/o]
  • Property ResultID As eResourceGridResultMapID [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property Statistics As IResourceGridStatistics [r/o]

IResourceGridResultsSet

  • Property AepResults As IResourceGridCalculationResult [r/o]
  • Property DeltaRixResults As IResourceGridCalculationResult [r/o]
  • Property PredictedClimateResults As IResourceGridCalculationResult [r/o]
  • Property RoseStructure As IRveaRoseStructureDefinition [r/o]
  • Property SiteEffectResults As IResourceGridCalculationResult [r/o]
  • Property VariableResultById(ByVal ResultID As eResourceGridResultMapID) As IResourceGridVariableResult [r/o]

IResourceGridStatistics

  • Property CountOfNodes As Long [r/o]
  • Property LocationOfMaximumNode As IRveaPoint [r/o]
  • Property LocationOfMinimumNode As IRveaPoint [r/o]
  • Property MaximumValue As Single [r/o]
  • Property MeanValue As Single [r/o]
  • Property MinimumValue As Single [r/o]
  • Property StandardDeviation As Single [r/o]

IResourceGridVariableResult

  • Property CountOfResultMaps As Long [r/o]
  • Property DoesHaveOmniDirectionalResultMap As Boolean [r/o]
  • Property DoesHaveSectorwiseResultMaps As Boolean [r/o]
  • Property OmniDirectionalResultMap As IResourceGridResultMap [r/o]
  • Property ResultID As eResourceGridResultMapID [r/o]
  • Property ResultMapByIndex(ByVal Index As Long) As IResourceGridResultMap [r/o]
  • Property SectorwiseResultMap(ByVal SectorIndex As Long) As IResourceGridResultMap [r/o]

IRoughnessRose

  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property FarthestChangeRadius As Single [r/o]
  • Property SectorForAngleDegrees(ByVal Angle As Single) As IRveaRoughnessRoseSectorEditable [r/o]
  • Property SectorForIndex(ByVal Index As Long) As IRveaRoughnessRoseSectorEditable [r/o]
  • Property SectorOneCentreAngleDegrees As Long [r/o]
  • Property SectorWithFarthestZoneExtent As IRveaRoughnessRoseSectorEditable [r/o]

IRvea0134Client

  • Property ProgressMonitor As IRveaProgressMonitor2 [r/o]

ISiteAssessment

  • Property CountOfSectors As Long [r/o]
  • Property DoesHaveRixInformation As Boolean [r/o]
  • Property ObstaclesCorrectionRose As IRveaWindCorrectionRose [r/o]
  • Property OrographicCorrectionRose As IRveaWindCorrectionRose [r/o]
  • Property RoughnessCorrectionRose As IRveaWindCorrectionRose [r/o]
  • Property RoughnessRose As IRveaRoughnessRose [r/o]
  • Property RuggednessIndex As Single [r/o]
  • Property SectorForAngleDegrees(ByVal Angle As Single) As ISiteAssessmentSector [r/o]
  • Property SectorForIndex(ByVal Index As Long) As ISiteAssessmentSector [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]

ISiteAssessmentSector

  • Property CountOfRoughnessChanges As Long [r/o]
  • Property MesoScaleRoughness As Single [r/o]
  • Property ObstaclesCorrection As IRveaWindCorrection [r/o]
  • Property OrographicCorrection As IRveaWindCorrection [r/o]
  • Property RoughnessCorrection As IRveaWindCorrection [r/o]
  • Property RuggednessIndex As Single [r/o]
  • Property Sector As IRveaRoseSector [r/o]

ISiteGroupHubHeightPolicy

  • Property AreHubHeightsUniform As Boolean [r/o]
  • Property IsPolicyRecursive As Boolean [r/o]
  • Property UniformHeight As Single [r/o]
  • Sub DisEngageUniformHeights(ByVal IsPolicyRecursive As Boolean)
  • Sub EngageUniformHeights(ByVal UniformHeight As Single, ByVal IsPolicyRecursive As Boolean)

ISourceFileTrace

  • Property AssociatedHierarchyMember As IHierarchyMember [r/o]
  • Property ImportingComputerName As String [r/o]
  • Property ImportingUserName As String [r/o]
  • Property ModifiedTime As Date [r/o]
  • Property ModifiedTimeForLastNotification As Date [r/w]
  • Property NotificationOption As eSourceFileTraceNotificationOptions [r/w]
  • Property OriginalName As String [r/o]
  • Sub ReImport([ByVal Filename As String = ""], [ByVal Filter As IRveaFileFilter = 0])

ISourceFileTraces

  • Property Count As Long [r/o]
  • Property SourceFileTrace(ByVal Index As Long) As ISourceFileTrace [r/o]
  • Property SourceFileTraceForObject(ByVal QueryObject As Object) As ISourceFileTrace [r/o]

ISpatialImage

  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsIMappableHierarchyMember As IMappableHierarchyMember [r/o]
  • Property CountOfScalingPoints As Long [r/o]
  • Property Extent As IRveaRectangle [r/o]
  • Property Image As StdPicture [r/o]
  • Property ScalingPointByIndex(ByVal Index As Long) As ISpatialImageScalingPoint [r/o]
  • Sub AddScalingPointSet(ByVal PointSet As ISpatialImageScalingPointSet)
  • Sub ClearScalingPointByIndex(ByVal Index As Long)
  • Sub ClearScalingPointByReference(ByVal Point As ISpatialImageScalingPoint)
  • Sub SetImage(ByRef Image As StdPicture, [ByVal DoClearAllDefinedScalingPoints As Boolean = False])

ISpatialImageScalingPoint

  • Property ImagePoint As IRveaPoint [r/o]
  • Property RealWorldPoint As IRveaPoint [r/o]
  • Sub Edit(ByVal ImageX As Single, ByVal ImageY As Single, ByVal RealWorldX As Single, ByVal RealWorldY As Single)

ISpatialImageScalingPointSet

  • Property Count As Long [r/o]
  • Property ScalingPointByIndex(ByVal Index As Long) As ISpatialImageScalingPoint [r/o]

ITurbineSite

  • Property AsICalculatingHierarchyMember As ICalculatingHierarchyMember [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsIRveaSite As IRveaSiteEditable [r/o]
  • Property AsITurbineSiteGroupMember As ITurbineSiteGroupMember [r/o]
  • Property AsIWaspSite As IWaspSite [r/o]
  • Property DeltaRixRose As IDeltaRixRose [r/o]
  • Property Description As String [r/w]
  • Property HasWakeEffectLosses As Boolean [r/o]
  • Property HubHeightAgl As Single [r/w]
  • Property PredictedWindClimate As IRveaWeibullWindRose [r/o]
  • Property ProductionRose As IRveaProductionRose [r/o]
  • Property Turbine As IRveaWindTurbineGenerator [r/o]
  • Function GetSuggestedInitialHeights() As IHeightGroup

ITurbineSiteGroupIterator

  • Property Count As Long [r/o]
  • Property CurrentMember As ITurbineSiteGroupMember [r/o]
  • Property FirstMember As ITurbineSiteGroupMember [r/o]
  • Property IsLastMember As Boolean [r/o]
  • Property IsSiteAMember(ByVal QuerySite As ITurbineSite) As Boolean [r/o]
  • Property NextMember As ITurbineSiteGroupMember [r/o]

ITurbineSiteGroupMember

  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property Description As String [r/w]
  • Property ParentGroup As IUnstructuredTurbineSiteGroup [r/o]

ITurbineSiteGroupSummaryResultsDatum

  • Property HighestSite As ITurbineSite [r/o]
  • Property IsThereData As Boolean [r/o]
  • Property LowestSite As ITurbineSite [r/o]
  • Property Maximum As Single [r/o]
  • Property Mean As Single [r/o]
  • Property Minimum As Single [r/o]
  • Property Total As Single [r/o]

ITurbineSiteGroupSummaryResultsSet

  • Property AepOmniDirectionalGross As ITurbineSiteGroupSummaryResultsDatum [r/o]
  • Property AepOmniDirectionalNet As ITurbineSiteGroupSummaryResultsDatum [r/o]
  • Property AepSumOfSectorsGross As ITurbineSiteGroupSummaryResultsDatum [r/o]
  • Property AepSumOfSectorsNet As ITurbineSiteGroupSummaryResultsDatum [r/o]
  • Property AllSectorsRix As ITurbineSiteGroupSummaryResultsDatum [r/o]
  • Property MeanSpeed As ITurbineSiteGroupSummaryResultsDatum [r/o]
  • Property TotalPowerDensity As ITurbineSiteGroupSummaryResultsDatum [r/o]
  • Property WakeLossProportional As ITurbineSiteGroupSummaryResultsDatum [r/o]

IUnstructuredTurbineSiteGroup

  • Property AsICalculatingHierarchyMember As ICalculatingHierarchyMember [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsITurbineSiteGroupMember As ITurbineSiteGroupMember [r/o]
  • Property AsIWindFarm As IWindFarm [r/o]
  • Property BoundingRectangle As IRveaRectangle [r/o]
  • Property ChildTurbineSites(ByVal DoAccumulateRecursively As Boolean) As IHierarchyMemberGroupIterator [r/o]
  • Property CreateIterator(ByVal CollapseGroupsToList As Boolean) As ITurbineSiteGroupIterator [r/o]
  • Property Description As String [r/w]
  • Property HubHeightPolicy As ISiteGroupHubHeightPolicy [r/o]
  • Property IsAWindFarm As Boolean [r/o]
  • Property IsSiteAMember(ByVal QuerySite As IWaspSite, ByVal SearchRecursively As Boolean) As Long [r/o]
  • Property MemberByDescription(ByVal Description As String) As ITurbineSiteGroupMember [r/o]
  • Property ParentWindFarm As IWindFarm [r/o]
  • Property SiteNearestToPoint(ByVal PointX As Single, ByVal PointY As Single, [ByVal RecurseSubGroups As Boolean = True]) As ITurbineSite [r/o]
  • Property SummaryResults As ITurbineSiteGroupSummaryResultsSet [r/o]
  • Sub AddSitesFromPortableSiteGroup(ByVal SourceGroup As IRveaPortableSiteGroup)

IUserCorrectionsRose

  • Property AreThereAnyCorrections As Boolean [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindCorrectionForAngleDegrees(ByVal Angle As Single) As IRveaWindCorrectionEditable [r/o]
  • Property WindCorrectionForSectorIndex(ByVal SectorIndex As Long) As IRveaWindCorrectionEditable [r/o]
  • Sub ClearAllCorrections()
  • Sub SetAllSectors(ByVal SpeedMultiplier As Single, ByVal DirectionDeflectionDegrees As Single)

IVectorMap

  • Property AllLines As IRveaPolyLineSet [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AssociatedMappableMembers As IHierarchyMemberGroupIterator [r/o]
  • Property BoundaryLines As IRveaPolyLineSet [r/o]
  • Property DataExtent As IRveaRectangle [r/o]
  • Property ElevationLines As IRveaPolyLineSet [r/o]
  • Property Extent As IRveaRectangle [r/o]
  • Property GEInfoBag As IGoogleEarthDisplayInfoBag [r/w]
  • Property MapProjection As IMapProjection [r/o]
  • Property RoughnessChangeLines As IRveaPolyLineSet [r/o]
  • Sub ChangeExtent(ByVal NewExtent As IRveaRectangle)
  • Sub ChangeMapProjection(ByVal MetricProjection As String, ByVal Datum As String, [ByVal Longitude As Long = 0], [ByVal Latitude As String = ""])
  • Function CutWindow(ByVal WindowExtent As IRveaRectangle) As IRveaVectorMap

IWakeDecaySettings

  • Property CountOfSectors As Long [r/o]
  • Property DoUseSameWakeDecayCoEfficient As Boolean [r/w]
  • Property IsDefault As Boolean [r/o]
  • Property OmniDirectionalWakeDecayCoEfficient As Single [r/w]
  • Property WakeDecayCoEfficientForSector(ByVal SectorIndex As Long) As Single [r/w]

IWaspProject

  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsIRveaConfigurable As IRveaConfigurable [r/o]
  • Property AsIRveaPreservableObject As IRveaPreservableObject [r/o]
  • Property HasAnyFeasibleCalculations As Boolean [r/o]
  • Property IncludeInWorkspaceFileAsReferenceOnly As Boolean [r/w]
  • Sub DoAllFeasibleCalculations()
  • Function FindSourceFileTraces() As ISourceFileTraces

IWaspSite

  • Property AllInfluencingObstacles As IRveaObstacleGroup [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsIRveaSite As IRveaSiteEditable [r/o]
  • Property Description As String [r/w]
  • Property Elevation As Single [r/o]
  • Property IsLocatedInMap As Boolean [r/o]
  • Property Location As IRveaPoint [r/o]
  • Property MustBeLocatedInMap As Boolean [r/w]
  • Property PredictedWindClimate As IRveaWeibullWindRose [r/o]
  • Property PredictedWindClimateCalculation As ICalculation [r/o]
  • Property SiteAssessment As ISiteAssessment [r/o]
  • Property SiteAssessmentCalculation As ICalculation [r/o]
  • Property UserCorrections As IUserCorrectionsRose [r/o]
  • Property WorkingHeightAgl As Single [r/w]
  • Sub ClearLocation()
  • Sub Move(ByVal NewLocationX As Single, ByVal NewLocationY As Single)

IWaspWorkspace

  • Property AllMembers As IHierarchyMemberGroupIterator [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsIRveaPreservableObject As IRveaPreservableObject [r/o]
  • Property Projects As IHierarchyMemberGroupIterator [r/o]
  • Sub DisableChangeRipples()
  • Sub ReEnableChangeRipples(ByVal RefreshAllAssociations As Boolean)
  • Sub SubscribeChangeObserver(ByVal Observer As IWorkspaceChangeObserver)
  • Sub UnSubscribeChangeObserver(ByVal Observer As IWorkspaceChangeObserver)

IWaspWorkspaceClass

  • Property AsIRveaPreservableClass As IRveaPreservableClass [r/o]
  • Function CreateNewInstance() As IWaspWorkspace
  • Function RestoreInstanceFromFile(ByVal Filename As String, [ByVal Filter As IRveaFileFilter = 0]) As IWaspWorkspace

IWindAtlas

  • Property AsICalculatingHierarchyMember As ICalculatingHierarchyMember [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property CountOfReferenceHeights As Long [r/o]
  • Property CountOfReferenceRoughnessLengths As Long [r/o]
  • Property CountOfSectors As Long [r/o]
  • Property Description As String [r/o]
  • Property DoesHaveData As Boolean [r/o]
  • Property MetStation As IMetStation [r/o]
  • Property ReferenceHeight(ByVal HeightIndex As Long) As Single [r/o]
  • Property ReferenceRoughnessLength(ByVal RoughnessLengthIndex As Long) As Single [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property SourceSiteAssessment As ISiteAssessment [r/o]
  • Property WeibullWindRose(ByVal RoughnessLengthIndex As Long, ByVal HeightIndex As Long) As IRveaWeibullWindRose [r/o]

IWindFarm

  • Property AllContributingSites As ITurbineSiteGroupIterator [r/o]
  • Property AsICalculatingHierarchyMember As ICalculatingHierarchyMember [r/o]
  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property AsIUnstructuredTurbineSiteGroup As IUnstructuredTurbineSiteGroup [r/o]
  • Property IsSiteAMember(ByVal QuerySite As ITurbineSite) As Boolean [r/o]
  • Property PowerCurve As IWindFarmPowerCurve [r/o]
  • Property ReferenceSite As IReferenceSite [r/o]
  • Property WakeDecaySettings As IWakeDecaySettings [r/o]

IWindFarmPowerCurve

  • Property CountOfSectors As Long [r/o]
  • Property RatedPower As Single [r/o]
  • Property SectorByIndex(ByVal SectorIndex As Long) As IWindFarmPowerCurveSector [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]

IWindFarmPowerCurveSector

  • Property CountOfEntries As Long [r/o]
  • Property PowerByIndex(ByVal Index As Long) As Single [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property SpeedByIndex(ByVal Index As Long) As Single [r/o]

IWindTurbineGenerator

  • Property AsIHierarchyMember As IHierarchyMember [r/o]
  • Property Comments As String [r/o]
  • Property CountOfDefaultHeights As Long [r/o]
  • Property CountOfPerformanceTables As Long [r/o]
  • Property DefaultHeight([ByVal Index As Long = 0]) As Single [r/o]
  • Property Description As String [r/o]
  • Property IsAirDensityMismatched As Boolean [r/o]
  • Property ManufacturerName As String [r/o]
  • Property PerformanceTable(ByVal Index As Long) As IRveaWtgPerformanceTable [r/o]
  • Property ReferenceURI As String [r/o]
  • Property RotorDiameter As Single [r/o]
  • Property SelectedPerformanceTable As IRveaWtgPerformanceTable [r/o]
  • Property SelectedPerformanceTableIndex As Long [r/w]

IWorkspaceChangeObserver

  • Sub NotifyChanges(ByVal ChangeGroup As IHierarchyChangeGroup)

Enum eAutoDescriptionGeneralPolicy

  • eadgpNone As Long=0
  • eadgpUniqueId As Long=1
  • eadgpCounter As Long=2
  • eadgpProperty As Long=3

Enum eCalculationResultType

  • ectNone As Long=0
  • ectWindFarmSummary As Long=8
  • ectProductionRose As Long=5
  • ectWakeLosses As Long=7
  • ectWindAtlas As Long=4
  • ectRoughnessRose As Long=3
  • ectSiteAssessment As Long=1
  • ectPredictedWindClimate As Long=2
  • ectDeltaRix As Long=9
  • ectParkPowerCurve As Long=6

Enum eCalculationStatus

  • echmsUnknown As Long=0
  • echmsResultsDirtyCannotCalculate As Long=1
  • echmsResultsOkCannotCalculate As Long=2
  • echmsResultsDirtyCanRecalculate As Long=3
  • echmsResultsOkCanRecalculate As Long=4

Enum eCuriousHierarchyChangeType

  • ephctAirDensityWtgMismatch As Long=11
  • ephctVectorMapProjectionChanged As Long=0
  • ephctWindFarmWakeCalculationsActiveStatusChange As Long=10
  • ephctWindFarmSitesWakeRefresh As Long=9
  • ephctUniformHubHeightSettingChanged As Long=8
  • ephctVectorMapExtentChanged As Long=7
  • ephctTurbineSiteGroupWindFarmChange As Long=6
  • ephctTurbineSiteGroupMemberChangedName As Long=5
  • ephctUserCorrectionsRoseStructureChange As Long=4
  • ephctSourceSiteAssessmentChange As Long=3
  • ephctHubHeightMismatch As Long=1
  • ephctRoseStructureMismatch As Long=2

Enum eDataHierarchyChangeType

  • edctUserCorrections As Long=4
  • edctDefiningData As Long=1
  • edctDescription As Long=2
  • edctSecondaryResultData As Long=3

Enum eHierarchyChangeType

  • ehcntCurious As Long=4
  • ehcntStructural As Long=1
  • ehcntStatus As Long=2
  • ehcntData As Long=3

Enum eHierarchyIrregularityType

  • ehitResultsInvalidatedByUpdate As Long=5
  • ehitParameterDefaultAdjustment As Long=4
  • ehitAirDensityWtgMismatch As Long=3
  • ehitRoughnessRoseWasCalculating As Long=2
  • ehitNone As Long=0
  • ehitWindFarmHubHeight As Long=1

Enum eHierarchyMemberClassID

  • ehmcSpatialImage As Long=15
  • ehmcReferenceSite As Long=14
  • ehmcNote As Long=13
  • ehmcResourceGrid As Long=10
  • ehmcTurbineSiteGroup As Long=12
  • ehmcWindTurbineGenerator As Long=11
  • ehmcWorkspace As Long=1
  • ehmcProject As Long=2
  • ehmcWindAtlas As Long=3
  • ehmcMetStation As Long=4
  • ehmcVectorMap As Long=5
  • ehmcObservedWindClimate As Long=6
  • ehmcTurbineSite As Long=7
  • ehmcObstacleGroup As Long=8
  • ehmcRoughnessRose As Long=9

Enum eReCalculationBehaviour

  • erbImmediate As Long=3
  • erbOnDemand As Long=2
  • erbOnCommand As Long=1

Enum eResourceGridResultMapID

  • ergmNone As Long=0
  • ergmOrographicDirectionCorrection As Long=15
  • ergmOrographicSpeedCorrection As Long=14
  • ergmRoughnessSpeedCorrection As Long=12
  • ergmObstaclesSpeedCorrection As Long=13
  • ergmMesoScaleRoughness As Long=11
  • ergmRoughnessChanges As Long=10
  • ergmElevation As Long=8
  • ergmRix As Long=7
  • ergmDeltaRix As Long=9
  • ergmSectorFrequency As Long=6
  • ergmAEP As Long=5
  • ergmPowerDensity As Long=4
  • ergmWeibullA As Long=1
  • ergmWeibullK As Long=2
  • ergmMeanSpeed As Long=3

Enum eSiteGroupHubHeightPolicy

  • esghhpParticularValue As Long=2
  • esghhpAncestorPolicy As Long=1
  • esghhpAdHoc As Long=0

Enum eSourceFileTraceNotificationOptions

  • enoIfChanged As Long=0
  • enoNeverAgain As Long=1
  • enoOnlyIfChangedAgain As Long=2

Enum eStructuralHierarchyChangeType

  • eshctChildReorder As Long=3
  • eshctChildMove As Long=2
  • eshctChildRemoval As Long=0
  • eshctChildAddition As Long=1


WAsP reporting assistant interfaces

When a WAsP script runs, it has access to a handful of support objects which can help in preparing reports and making sense of the hierarchy. The most useful of these is the ReportingAssistant, which is of type WaspReportingAssistant

This gives you access to a CastableSelectedMember object which lets you immediately type cast the currently selected hierarchy member into the interface you need.

  • ColourPreferences
  • FileDialogAssistant
  • GridMapAnalyser
  • HTMLDocumentBuilder
  • HTMLDocumentBuilderFactory
  • Illustrator
  • IRvea0135DataFormatting
  • IRvea0135ResourceGridColouring
  • TypeCastableSelectedMember
  • TypeCaster
  • WaspReportingAssistant

WaspReportingAssistant

  • Property AllClasses As IHierarchyMemberClasses [r/o]
  • Property CastableSelectedMember As TypeCastableSelectedMember [r/o]
  • Property ClientLicence As IRveaProductLicence [r/o]
  • Property ClientLicenceUserName As String [r/o]
  • Property ClientVersion As String [r/o]
  • Property DataFormatting As IRvea0135DataFormatting [r/o]
  • Property HTMLDocumentBuilderFactory As HTMLDocumentBuilderFactory [r/o]
  • Property Illustrator As Illustrator [r/o]
  • Property SelectedHierarchyMember As IHierarchyMember [r/w]
  • Property TypeCaster As TypeCaster [r/o]
  • Property WordTemplateFilename As String [r/o]
  • Function CreateFileDialog() As FileDialogAssistant
  • Function CreateGridMapAnalyser(ByVal RealGridMap As IRveaRealGridMap) As GridMapAnalyser
  • Function CreateHTMLDocumentBuilder(ByVal Title As String) As HTMLDocumentBuilder
  • Function CreateUserInteractionPoint(ByVal Key As String, ByVal GUID As String) As cUserInteractionPoint
  • Sub DisplayFileInNotepad(ByVal Filename As String)
  • Sub DisplaySimpleReport(ByVal ReportText As String, [ByVal Title As String])
  • Function EvaluateUsUkFormatNumber(ByVal NumberString As String) As Double
  • Function FormatValueWithPointDecimal(ByVal DataValue As Single) As String
  • Function GetRegistryKey(ByVal KeyPath As String) As RegistryKey
  • Function GetTemporaryFilename() As String
  • Sub LaunchExplorer(ByVal Path As String)
  • Function NumberFormat(ByVal SourceString As Variant, ByVal Formatting As String, [ByVal ForcePointDecimal As Boolean = True], [ByVal MinimumCharacterCount As Long]) As String

Illustrator

  • Property ColourPreferences As ColourPreferences [r/o]
  • Property Height As Long [r/w]
  • Property SelectedResourceGrid As IResourceGrid [r/w]
  • Property Width As Long [r/w]
  • Sub DrawASiteInTheMap(ByVal OutputFilename As String, ByVal VectorMap As IVectorMap, ByVal Site As IRveaSite, [ByVal DrawAsMetStation As Boolean])
  • Sub DrawAWindFarmInTheMap(ByVal OutputFilename As String, ByVal VectorMap As IVectorMap, ByVal AllSites As IHierarchyMemberGroupIterator)
  • Sub DrawColourScaleBox(ByVal OutputFilename As String, ByVal ResultMap As IResourceGridResultMap, ByVal ColouringSystem As IRvea0136DataColouringSystem, ByVal MinimumValue As Single, ByVal MaximumValue As Single, [ByVal TransparencyColour As Long = -1])
  • Sub DrawCorrectionRoseToImageFile(ByVal OutputFilename As String, ByVal Location As IRveaPoint, ByVal ContextArea As IRveaRectangle, ByVal Rose As IRveaWindCorrectionRose, ByVal RoseRadiusPixels As Single, ByVal RoseDataColour As Long, [ByVal TransparencyColour As Long = -1])
  • Sub DrawImageToFile(ByVal OutputFilename As String, ByVal Image As StdPicture, [ByVal TransparencyColour As Long = -1])
  • Sub DrawObstacleGroup(ByVal OutputFilename As String, ByVal ObstacleGroup As IRveaObstacleGroup, [ByVal Site As IRveaSite], [ByVal DrawAsMetStation As Boolean])
  • Sub DrawObstacleGroupWithOwnOrigin(ByVal OutputFilename As String, ByVal ObstacleGroup As IRveaObstacleGroup)
  • Sub DrawOwcRose(ByVal OutputFilename As String, ByVal Owc As IRveaObservedWindClimate, [ByVal SelectedSectorIndex As Long], [ByVal SpecifiedOuterRingValue As Single])
  • Sub DrawOwcSectorHistogram(ByVal OutputFilename As String, ByVal Owc As IRveaObservedWindClimate, [ByVal SelectedSectorIndex As Long], [ByVal DisplayFitComparisons As Boolean = False])
  • Sub DrawProductionRose(ByVal OutputFilename As String, ByVal ProductionRose As IRveaProductionRose, [ByVal SelectedSectorIndex As Long])
  • Sub DrawProductionRoseSector(ByVal OutputFilename As String, ByVal ProductionRose As IRveaProductionRose, ByVal SelectedSectorIndex As Long)
  • Sub DrawProductionRoseToImageFile(ByVal OutputFilename As String, ByVal Location As IRveaPoint, ByVal ContextArea As IRveaRectangle, ByVal Rose As IRveaProductionRose, ByVal RoseRadiusPixels As Single, ByVal RoseDataColour As Long, [ByVal ScaleToTotalPowerValue As Single], [ByVal DoShowGrossValues As Boolean], [ByVal WakeLossColour As Long], [ByVal TransparencyColour As Long = -1])
  • Sub DrawResourceGridColourScaleBox(ByVal OutputFilename As String, ByVal ResultMap As IResourceGridResultMap)
  • Sub DrawResourceGridInMap(ByVal OutputFilename As String, ByVal VectorMap As IVectorMap, ByVal GridMap As IRveaRealGridMap)
  • Sub DrawResourceGridResultInMap(ByVal OutputFilename As String, ByVal VectorMap As IVectorMap, ByVal GridMap As IRveaRealGridMap, ByVal ResultMapID As eResourceGridResultMapID, [ByVal Mask As IRveaRealGridMap], [ByRef DrawColorScaleBox As Boolean])
  • Sub DrawResourceGridResultOnly(ByVal OutputFilename As String, ByVal GridMap As IRveaRealGridMap, ByVal ResultMapID As eResourceGridResultMapID, [ByVal Mask As IRveaRealGridMap], [ByVal DrawColorScaleBox As Boolean], [ByVal ColuringSystem As IRvea0136DataColouringSystem], [ByVal TransparencyColour As Long = -1])
  • Sub DrawRoughnessRose(ByVal OutputFilename As String, ByVal Rose As IRveaRoughnessRose, [ByVal SelectedSector As IRveaRoughnessRoseSector], [ByVal SelectedZone As IRveaRoughnessRoseSectorZone], [ByVal HideDistanceScale As Boolean = False], [ByVal HideColourScale As Boolean = False])
  • Function DrawWeibullWindRose(ByVal OutputFilename As String, ByVal WeibullWindRose As IRveaWeibullWindRose, [ByVal SelectedSectorIndex As Long], [ByVal SpecifiedOuterRingValue As Single], [ByVal TransparencyColour As Long = -1]) As StdPicture
  • Sub DrawWeibullWindRoseForComparison(ByVal OutputFilename As String, ByVal WeibullWindRose As IRveaWeibullWindRose, ByVal BackgroundRose As IRveaWeibullWindRose, [ByVal SelectedSectorIndex As Long], [ByVal SpecifiedOuterRingValue As Single])
  • Sub DrawWeibullWindRoseSector(ByVal OutputFilename As String, ByVal WeibullRose As IRveaWeibullWindRose, ByVal SelectedSectorIndex As Long)
  • Sub DrawWeibullWindRoseSectorForComparison(ByVal OutputFilename As String, ByVal WeibullWindRose As IRveaWeibullWindRose, ByVal BackgroundRose As IRveaWeibullWindRose, [ByVal SelectedSectorIndex As Long])
  • Sub DrawWeibullWindRoseToImageFile(ByVal OutputFilename As String, ByVal Location As IRveaPoint, ByVal ContextArea As IRveaRectangle, ByVal Rose As IRveaWeibullWindRose, ByVal RoseRadiusPixels As Single, ByVal RoseDataColour As Long, [ByVal DrawPowerDensity As Boolean = False], [ByVal Corrections As IRveaWindCorrectionRose], [ByVal CorrectionColour As Long], [ByVal TransparencyColour As Long = -1])
  • Sub DrawWtgPerformanceTable(ByVal OutputFilename As String, ByVal Table As IRveaWtgPerformanceTable)

ColourPreferences

  • Property AttentionColour As Long [r/w]
  • Property AxesColour As Long [r/w]
  • Property BackColour As Long [r/w]
  • Property BoundaryLineColour As Long [r/w]
  • Property ConstructionLineColour As Long [r/w]
  • Property DoShowRoughnessChangeLinesAsTwoLines As Boolean [r/w]
  • Property ElevationContourLabelColour As Long [r/w]
  • Property ElevationContoursColour As Long [r/w]
  • Property HighlightDataColour As Long [r/w]
  • Property MapBackgroundColour As Long [r/w]
  • Property NegativeCorrectionColour As Long [r/w]
  • Property NormalDataColour As Long [r/w]
  • Property ObstacleEffectsColour As Long [r/w]
  • Property ObstaclePropertyPalette As IPalette256 [r/o]
  • Property OrographicEffectsColour As Long [r/w]
  • Property PositiveCorrectionColour As Long [r/w]
  • Property PowerColour As Long [r/w]
  • Property ResourceGridColouring As IRvea0135ResourceGridColouring [r/o]
  • Property ResourceGridDataPalette As IPalette256 [r/o]
  • Property RoughnessChangeLineColour As Long [r/w]
  • Property RoughnessColourPalette As IPalette256 [r/o]
  • Property RoughnessEffectsColour As Long [r/w]
  • Property SuperHighlightDataColour As Long [r/w]
  • Property WindColour As Long [r/w]
  • Sub ChangeObstaclePropertyPalette(ByVal NewPalette As IPalette256)
  • Sub ChangeResourceGridDataPalette(ByVal NewPalette As IPalette256)
  • Sub ChangeRoughnessColourPalette(ByVal NewPalette As IPalette256)
  • Function GetObstaclePropertyColour(ByVal PropertyValue As Single) As Long
  • Function GetRoughnessColour(ByVal RoughnessLength As Single) As Long
  • Sub RestoreDefaults()

FileDialogAssistant

  • Function PromptForOpen([ByVal DialogTitle As String = ""], [ByVal Filename As String = ""], [ByVal FilterString As String = ""]) As String
  • Function PromptForSave([ByVal DialogTitle As String = ""], [ByVal Filename As String = ""], [ByVal FilterString As String = ""]) As String

GridMapAnalyser

  • Property Maximum As Single [r/o]
  • Property MaximumX As Single [r/o]
  • Property MaximumY As Single [r/o]
  • Property Mean As Single [r/o]
  • Property Minimum As Single [r/o]
  • Property MinimumX As Single [r/o]
  • Property MinimumY As Single [r/o]

HTMLDocumentBuilder

  • Property HTML As String [r/o]
  • Sub AddText(ByVal Text As String)
  • Sub AppendHTMLBlock(ByVal Block As String)
  • Sub EndCustomElement(ByVal ElementTag As String)
  • Sub EndElement([ByVal TagType As eHtmlTagTypes])
  • Sub EndH1Element()
  • Sub EndH2Element()
  • Sub EndH3Element()
  • Sub EndH4Element()
  • Sub EndListItemElement()
  • Sub EndOrderedListElement()
  • Sub EndParagraphElement()
  • Sub EndTableDataElement()
  • Sub EndTableDataHeaderRowElement()
  • Sub EndTableElement()
  • Sub EndTableRowElement()
  • Sub EndUnorderedListElement()
  • Sub Finish()
  • Function GetAuxilliaryFileName([ByVal FileTitle As String], [ByVal Extension As String]) As String
  • Sub InsertClosedCustomElement(ByVal ElementTag As String, [ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedElement(ByVal TagType As eHtmlTagTypes, [ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedH1Element([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedH2Element([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedH3Element([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedH4Element([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedHeaderElement(ByVal TagType As eHtmlTagTypes, [ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedListItemElement([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedOrderedListElement([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedParagraphElement([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedTableDataElement([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedTableDataHeaderRowElement([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedTableElement([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedTableRowElement([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertClosedUnOrderedListElement([ByVal TextContent As String], [ByVal Attributes As String])
  • Sub InsertHorizontalRule()
  • Sub InsertHyperlink(ByVal URL As String, ByVal LinkText As String)
  • Sub InsertImage(ByVal ImageFileName As String, [ByVal Attributes As String])
  • Sub InsertLineBreak()
  • Sub InsertTimeStamp()
  • Sub LaunchInBrowser()
  • Sub StartCustomElement(ByVal ElementTag As String, [ByVal Attributes As String])
  • Sub StartElement(ByVal TagType As eHtmlTagTypes, [ByVal Attributes As String])
  • Sub StartH1Element([ByVal Attributes As String])
  • Sub StartH2Element([ByVal Attributes As String])
  • Sub StartH3Element([ByVal Attributes As String])
  • Sub StartH4Element([ByVal Attributes As String])
  • Sub StartListItemElement([ByVal Attributes As String])
  • Sub StartOrderedListElement([ByVal Attributes As String])
  • Sub StartParagraphElement([ByVal Attributes As String])
  • Sub StartTableDataElement([ByVal Attributes As String])
  • Sub StartTableDataHeaderRowElement([ByVal Attributes As String])
  • Sub StartTableElement([ByVal Attributes As String])
  • Sub StartTableRowElement([ByVal Attributes As String])
  • Sub StartUnorderedListElement([ByVal Attributes As String])
  • Sub WriteToFile([ByVal SavingFilename As String])

HTMLDocumentBuilderFactory

  • Property HeaderScript(ByVal String) [w/o]
  • Property HeaderScriptLanguage(ByVal String) [w/o]
  • Property HeaderStyle(ByVal String) [w/o]
  • Sub ClearHeaderData()
  • Function CreateHTMLDocumentBuilder(ByVal Title As String, ByVal Filename As IFilename, ByVal StyleSheetFilenames As Collection, ByVal MetaTags As Variant, [ByVal JavascriptFilenames As Collection], [ByVal DoInclduePrintScripting As Boolean]) As HTMLDocumentBuilder

IRvea0135DataFormatting

  • Function FormatAep(ByVal Production As Single, [ByVal AppendUnits As Boolean = False], [ByVal ScaleToMax As Single], [ByVal AsARateVsSpeed As Boolean]) As String
  • Function FormatDeflectionAngleDegrees(ByVal Angle As Single, [ByVal AppendUnits As Boolean = False]) As String
  • Function FormatFrequencyAsPercentage(ByVal Frequency As Single, [ByVal AppendUnits As Boolean = False], [ByVal AsARateVsSpeed As Boolean]) As String
  • Function FormatMapCoordinates(ByVal LocationX As Single, ByVal LocationY As Single) As String
  • Function FormatPowerDensity(ByVal PowerDensity As Single, [ByVal AppendUnits As Boolean = False], [ByVal AsARateVsSpeed As Boolean]) As String
  • Function FormatPowerValue(ByVal PowerValue As Single, [ByVal AppendUnits As Boolean = False], [ByVal ScaleToMax As Single], [ByVal AsARateVsSpeed As Boolean]) As String
  • Function FormatResourceGridValue(ByVal Value As Single, ByVal ResourceGridResultID As eResourceGridResultMapID, [ByVal AppendUnits As Boolean = False]) As String
  • Function FormatRixValue(ByVal Value As Single, [ByVal AppendUnits As Boolean = False]) As String
  • Function FormatRoughnessLength(ByVal RoughnessLength As Single, [ByVal AppendUnits As Boolean = False]) As String
  • Function FormatSectorAngleDegrees(ByVal Angle As Single, [ByVal AppendUnits As Boolean = False]) As String
  • Function FormatSpeedMultiplierToPercentage(ByVal Multiplier As Single, [ByVal AppendUnits As Boolean = False]) As String
  • Function FormatThrustCoEfficient(ByVal Value As Single) As String
  • Function FormatWakeLossProportion(ByVal Loss As Single, [ByVal AppendUnits As Boolean = False]) As String
  • Function FormatWeibullA(ByVal WeibullA As Single, [ByVal AppendUnits As Boolean = False]) As String
  • Function FormatWeibullK(ByVal WeibullK As Single) As String
  • Function FormatWindSpeed(ByVal WindSpeed As Single, [ByVal AppendUnits As Boolean = False]) As String
  • Function GetAepUnits(ByVal Value As Single) As String
  • Function GetPowerUnits(ByVal PowerValue As Single) As String

IRvea0135ResourceGridColouring

  • Property System(ByVal ResourceGridResultMapID As eResourceGridResultMapID) As IRvea0136DataColouringSystem [r/o]

TypeCastableSelectedMember

  • Property AsIMetStation As IMetStation [r/o]
  • Property AsIObservedWindClimate As IObservedWindClimate [r/o]
  • Property AsIObstacleGroup As IObstacleGroup [r/o]
  • Property AsIResourceGrid As IResourceGrid [r/o]
  • Property AsIRoughnessRose As IRoughnessRose [r/o]
  • Property AsITurbineSite As ITurbineSite [r/o]
  • Property AsIUnstructuredTurbineSiteGroup As IUnstructuredTurbineSiteGroup [r/o]
  • Property AsIVectorMap As IVectorMap [r/o]
  • Property AsIWaspProject As IWaspProject [r/o]
  • Property AsIWaspWorkspace As IWaspWorkspace [r/o]
  • Property AsIWindAtlas As IWindAtlas [r/o]
  • Property AsIWindFarm As IWindFarm [r/o]
  • Property AsIWindTurbineGenerator As IWindTurbineGenerator [r/o]
  • Sub Create(ByVal Member As IHierarchyMember)

TypeCaster

  • Function CastMemberToCalculatingHierarchyMember(ByVal Member As IHierarchyMember) As ICalculatingHierarchyMember
  • Function CastMemberToExportableHierarchyMember(ByVal Member As IHierarchyMember) As IExportableHierarchyMember
  • Function CastMemberToImportedHierarchyMember(ByVal Member As IHierarchyMember) As IImportedHierarchyMember
  • Function CastMemberToMappableHierarchyMember(ByVal Member As IHierarchyMember) As IMappableHierarchyMember
  • Function CastMemberToMetStation(ByVal Member As IHierarchyMember) As IMetStation
  • Function CastMemberToNote(ByVal Member As IHierarchyMember) As INote
  • Function CastMemberToObservedWindClimate(ByVal Member As IHierarchyMember) As IObservedWindClimate
  • Function CastMemberToObstacleGroup(ByVal Member As IHierarchyMember) As IObstacleGroup
  • Function CastMemberToPortableSiteGroupProvider(ByVal Member As IHierarchyMember) As IPortableSiteGroupProvider
  • Function CastMemberToPreservableObject(ByVal Member As IHierarchyMember) As IRveaPreservableObject
  • Function CastMemberToProject(ByVal Member As IHierarchyMember) As IWaspProject
  • Function CastMemberToReferenceSite(ByVal Member As IHierarchyMember) As IReferenceSite
  • Function CastMemberToResourceGrid(ByVal Member As IHierarchyMember) As IResourceGrid
  • Function CastMemberToRoughnessRose(ByVal Member As IHierarchyMember) As IRoughnessRose
  • Function CastMemberToRveaConfigurable(ByVal Member As IHierarchyMember) As IRveaConfigurable
  • Function CastMemberToRveaPortableSite(ByVal Member As IHierarchyMember) As IRveaPortableSite
  • Function CastMemberToTurbineSite(ByVal Member As IHierarchyMember) As ITurbineSite
  • Function CastMemberToUnstructuredTurbineSiteGroup(ByVal Member As IHierarchyMember) As IUnstructuredTurbineSiteGroup
  • Function CastMemberToVectorMap(ByVal Member As IHierarchyMember) As IVectorMap
  • Function CastMemberToWaspSite(ByVal Member As IHierarchyMember) As IWaspSite
  • Function CastMemberToWindAtlas(ByVal Member As IHierarchyMember) As IWindAtlas
  • Function CastMemberToWindFarm(ByVal Member As IHierarchyMember) As IWindFarm
  • Function CastMemberToWindTurbineGenerator(ByVal Member As IHierarchyMember) As IWindTurbineGenerator
  • Function CastMemberToWorkspace(ByVal Member As IHierarchyMember) As IWaspWorkspace
  • Function CastObjectToResourceGridResultMap(ByVal SourceObject As Object) As IResourceGridResultMap
  • Function CastObjectToRveaPreservableObject(ByVal SourceObject As Object) As IRveaPreservableObject
  • Function CastObjectToRveaWindAtlas(ByVal SourceObject As Object) As IRveaWindAtlas
  • Function CastRveaRoughnessRoseToPreservableObject(ByVal Rose As IRveaRoughnessRose) As IRveaPreservableObject
  • Function CastRveaWeibullDistributionToRveaWeibullDistributionEditable(ByVal Distribution As IRveaWeibullDistribution) As IRveaWeibullDistributionEditable
  • Function NumberForID(ByVal ID As eHierarchyMemberID) As Long

Enum eHeaderScriptLanguage

  • ehslJavascript As Long=1
  • ehslVBScript As Long=2

Enum eHtmlTagTypes

  • eHttParagraph As Long=0
  • eHttH1 As Long=1
  • eHttH2 As Long=2
  • eHttH3 As Long=3
  • eHttH4 As Long=4
  • eHttTable As Long=5
  • eHttTableRow As Long=6
  • eHttUnOrderedList As Long=7
  • eHttOrderedList As Long=8
  • eHttListItem As Long=9
  • eHttTableData As Long=11
  • eHttTableDataHeaderRow As Long=12
  • eHttStyle As Long=13
  • eHttScript As Long=14


WEngScriptIntroPage

Scripting in WAsP Engineering

This documentation emphasises the use of scripting for generating reports.

WAsP Engineering 2.0 ships with a handful of report scripts, most of which generate reports in MS Word.


How to start

Getting started

Before you do anything....

If you're planning to edit the scripts, or to add your own, then it might be a good idea to change the setting which controls which folder stores the scripts.

What do you want to do?

Make a minor change to an existing script

  • Make a backup copy of the original script, in case you want to undo your changes
  • Open the script in a text editor like NotePad, or - better - an XML editor like XMLSpy
  • Scan the document which describes the contents: Anatomy of a script file
  • You might want to change the Description attribute to show that the script is edited
  • Identify the CDATA block which contains the actual script code
  • Try to work out which part of the script has the bit you want to change
  • Use the search facility here to discover more about what you want to edit
  • Make the change
  • You could insert some message box debugging hints around your edit
  • Save the script file
  • Run the script from within WEng. The program will read the new version.

Make a new report script

  • Make a new file with the relevant XML container code (you can copy the XML from another script, or use a template)
  • Save it to the right folder for WEng to find it
  • Decide which kind of output you want (Excel, HTML, Word, Text, etc)
  • Find another script which has the same kind of output
  • Copy the relevant setup code from the source script
  • Put some trivial information in for testing, insert a test message box
  • Save the script file
  • If you have a good XML editor, use the script schema to test the format of the file
  • Restart WEng, and check that the script appears in the menu
  • Open a project and run the script from within WEng
  • Read about the object model, and look for examples in existing scripts which do what you want
  • Insert the new functions, one at a time, and test each time
  • When you're happy, just strip out the debuggin message boxes


How scripts work in WEng

How scripts work in WAsP Engineering

Scripts use the interfaces of the 'ProjectSpace'

The main WEng program, the graphical user interface (GUI), does not do any modelling work itself: it simply provides a user interface to work with an underlying set of objects called the 'ProjectSpace'. These objects handle all the modelling work, and provide representations of all the components of the modelling situation. The objects correspond to the things displayed in the main GUI. For example, each project has a group of winds, sites and heights. The ProjectSpace objects are provided by a separate component (in WEng 2.0, by a DLL called Rvea0081).

When a script runs inside the WEng program, it works with the ProjectSpace , and is completely ignorant about the GUI itself. The arrows in the sketch diagram below show direction of 'visibility'.

The ProjectSpace objects offer methods and properties that can be used:

  • to open, create, save and close WEng projects
  • to manipulate the structure and contents an open WEng project
  • to retrieve values and results from an open WEng project
  • to monitor changes to an open WEng project

The last of these (monitoring changes to a project) is of course mostly useful to the main GUI program, which must update its representation of the project when changes are made. The first two (project file operations, project editing) are used by the GUI, but can also be used by other clients (for example a VBA macro running in MS Word or MS Excel).

For reporting scripts, it's the third (getting numbers out from the project) which is most useful. When a reporting script runs from within WEng, the GUI has already opened a project. A script can make changes to the currently open project, but most reporting scripts just collect information about the project and add it to a report.

Note that in the projectspace there are no 'calculate' commands. All results are calculated on demand, so simply reading a value is enough to invoke a calculation automatically if needed.

Reporting scripts will usually produce some kind of output, be it a file, a message box, and Excel spreadsheet or a Word document. To do this, the scripts must themselves create the files, objects and so on required for the output, using automation interfaces from the Windows system or other applications.


Anatomy of a script file

The script file

Each script is saved in its own file. WEng 2 script files have the extension *.wes2. They are ASCII files, so you can just open them in Notepad or Internet Explorer to look at their contents.

The files themselves are written in XML, but contain a CDATA block which represents the actual script code. The XML is just used to provide meta-data: a context within which the script itself can be interpreted.

The CDATA block of actual script code should begin with a Sub Main() statement. The GUI executes each script by loading in the code and calling Main.

The XML

There is an XML schema for the script files, which defines precisely what the files can contain. The schema is documented here. It can be used to validate edited scripts, but of course it will not be able to check the contents of the code itself which is embedded in the CDATA block.

The <RveaWengInternalScript> element

The script file's top level element is called <RveaWengInternalScript>, it has four attributes.

Three are to do with the format version of the script. These attributes are needed so that if we change the format in future, the program can continue to work with older ones. If you are making a new script, then you should set the CurrentApplicationVersion to the version of WEng which you can discover from the About box on the Help menu. Make sure that you use the correct format XX.XX.XXXX. If in doubt, set the MinimumApplicationVersion to the same value as the CurrentApplicationVersion.

The fourth attribute, 'Description', is the name of the script as it will appear in the script menu in the main program.

The <ScriptType> element

The script can only be of one type, which (at the time of writing) is constrained to be one of the following:

  • WordReport
  • HtmlReport
  • ExcelReport
  • Utility

WEng uses this property to try to check that you've got the right output program installed. Most of the supplied sample scripts are MSWord, so WEng will try to raise a helpful error if Word is not installed. The GUI will not actually prevent the you from trying to run the scripts, even if it thinks that the required programs are not available.

The <RequiredProjectSelection> element(s)

Some scripts require and assume that various project members are available in the currently open project, and have been selected by highlighting them in the tree views on the left hand side of the main menu

The script XML can contain one or more declarations about what selections are required. So for example, the script can say that it needs a height to be selected. The WEng GUI will use these requirements declarations to govern the enablement/disablement of the various scripts according to the current project selections.

Here is a list of the possible selections.

  • epmtAny
  • epmtHeight
  • epmtWind
  • epmtObservedExtremeWindClimate
  • epmtRegionalExtremeWindClimate
  • epmtGenericExtremeWindClimate
  • epmtMeasuredWind
  • epmtGeostrophicWind
  • epmtReducedGeostrophicWInd
  • epmtSite
  • epmtSiteOrSiteGroup
  • epmtUnstructuredSiteGroup
  • epmtTransectSiteGroup
  • epmtVectorMap
  • epmtGridMap

Note that some of the types include others. If a Wind is required, then it could be a ReducedGeostrophicWind, or a MeasuredWind or a Geostrophic wind. Similarly, for extreme wind climates, if a GenericExtremeWindClimate is specified, then either an observed or regional one would be acceptable.

Note that in many of the sample scripts, the script will often attempt to guess the selection. For example, it will try to find a height if none is explicitly selected, by taking the first height found in the project.

The <Invocation> element

This is an optional XML element, and is used for complex scripts which must invoke other Risoe applications such as WAsP, or the Climate Analyst. This is an advanced setting which is used to ensure that the necessary licence permissions for calculation are propagated. Please contact Risoe for more assistance with use of this element.

The <ScriptCode> element

This contains the script code itself, in a CDATA block.

Another document describes the contents of this block.


ScriptTemplate

An empty script template

You can use this template to set up a new script. Copy the whole lot and paste it into an empty text file. Save with a *.wes2 extension to the appropriate folder.

You will need to edit the template before it's OK. For more guidance, see the anatomy of a script section. To check that it's correctly formatted, you can use the schema.

<?xml version="1.0" encoding="UTF-8"?>
<RveaWengInternalScript
MinimumApplicationVersion="02.00.0047"
CurrentApplicationVersion="02.00.0047"
FormatVersion="01.01.0001"
Description="Enter a description here"
ScriptInstanceVersion="Put a version stamp here" >

<ScriptType> Select from :-
WordReport
HtmlReport
ExcelReport
TextFile
Utility
</ScriptType>

<RequiredProjectSelection> Choose one of the following:-
epmtAny
epmtHeight
epmtHeightOrHeightGroup
epmtWind
epmtWindOrWindGroup
epmtObservedExtremeWindClimate
epmtRegionalExtremeWindClimate
epmtGenericExtremeWindClimate
epmtMeasuredWind
epmtGeostrophicWind
epmtReducedGeostrophicWInd
epmtSite
epmtSiteOrSiteGroup
epmtUnstructuredSiteGroup
epmtTransectSiteGroup
epmtVectorMap
epmtGridMap
epmtGenericExtremeWindClimate
</RequiredProjectSelection>
<Comment>Put a comment in here if you like</Comment>
<ScriptCode><![CDATA[

Sub Main()

End Sub

]]></ScriptCode>

</RveaWengInternalScript>


How WEng finds and uses scripts

How WEng finds and uses the script files

How WEng finds scripts

Putting a script file in a particular folder is all that is required to tell WEng about a script. The WEng GUI searches for available scripts when it starts and compiles a list. The list of scripts appears as a sub menu on the main program window, under Tools.. Reporting..

The location of the scripts folder depends of course on where the application has been installed, but the default would be:

    c:\Program Files\Wasp\Internal scripts\Wasp Engineering\

When WEng finds scripts

The WEng GUI compiles a list of scripts when the program starts, and does not re-compile the list while it is running unless you change the script search path in the options dialog (see below). So, adding a script file to one the scripts folder will not cause it to be added to the scripting menu items available to the user until the program is re-started.

Which folder is used

To discover the location of the scripts folder, WAsP looks in the system registry at:

    HKEY_CURRENT_USER\Software\Risoe National Laboratory\Wasp Engineering\Version 1\Scripts path

A typical value would of course be:

    c:\Program Files\Wasp\Internal scripts\Wasp Engineering\

To change the path of the scripts folder, use Tools.. Options. The list of scripts will be refreshed automatically if you change the search path: there's no need to re-start the program.

If you're planning to edit the scripts, or to add your own, then it might be a good idea to change this folder setting so that it's not pointing to \program files\, but instead to your own data folders (for example somewhere in My documents). That might ensure that the scripts are backed up properly, and can be more easily moved to a new computer.

Different versions, different extensions: *.wes and *.wes2

WEng version 1 had script files which used the extension *.wes. Version 2 uses a different extension: *.wes2. If you have installed version 1 of WEng at some time, you might notice some *.wes files in your filesyste. WEng 2 won't use them or get confused: it only works with *.wes2 files.

What's a *.was ?

Note that if WAsP is installed on the machine, there will be another directory alongside containing WAsP scripts, but these will have the extension *.was. WEng will ignore these scripts.

When WEng reads the scripts' contents

WEng reads the script contents every time they are needed. So, editing and saving a script (to the same file name) will cause the new version to be used immediately. There is no need to re-start the program. This makes it a bit quicker to test and debug scripts.


Script execution context

When a script runs inside WEng, the GUI sets things up so that the script can retrieve information about what's happening in the program.

The most important of these, of course, is a reference to the currently-open project itself.

Some scripts are intended to work with only one wind, site or height, and the GUI makes it possible for a script to discover which are currently selected in the GUI (the ones currently selected in the hierarchy trees on the left hand side of the main window).

Just before a script is executed, the WEng GUI program inserts number of objects into the script's scope. When the script runs, it can just reference these objects directly.

The selection context

The currently open project can be referenced, and the script can also discover which project members are currently selected in the GUI (highlighted in the tree views on the left hand side of the main window).

The script can access the following objects. The interface type of each is shown in brackets. See here for more detailed information about these interfaces.

  • CurrentProject (IWengProject)
  • CurrentThing (Object)
  • CurrentWindGroupMember (IWindGroupMember)
  • CurrentEWC (IGenericExtremeWindClimate)
  • CurrentHeight (IHeight)
  • CurrentSite (ISite)
  • CurrentSiteGroup (ISiteGroup)
  • CurrentTransect (ITransectSiteGroup)

Note that any of these (except CurrentProject) can contain 'nothing' if there is no current selection of an object of that type. For example, if there is a CurrentWindGroupMember, then there will not be CurrentEWC, and vice versa, because only one can be selected at a time.

These can be used by the script as follows:

ProjectName = CurrentProject.Description

If CurrentSite Is Nothing Then
MsgBox("There is no site selected")
End If

The scripting context

In addition, there are a couple of other ready-instantiated objects and assigned values in scope which the script can access.

  • A string called ScriptInfo, which includes a description of the script and a version number
  • A string called UserInfo, which has a description of the licenced user who is running WEng
  • The TypeCaster object, which provides helper methods for type casting, and a selection of useful constants.


The WAsP Engineering objects

The WAsP Engineering projectspace objects


The project

The script can get a reference to the currently opened project by using the variable 'CurrentProject'.

Basic properties

The project is an IWengProject. It has a name property corresponding to the project file name title ...

  • Property Name As String

... and it has the following child objects which can be retrieved as properties:

  • Property Domain As IProjectDomain
  • Property Heights As IHeightGroup
  • Property Sites As IUnstructuredSiteGroup
  • Property Winds As IUnstructuredWindGroup

Those let you navigate over the members of the project. Heights, Sites and Winds are each is documented in its own section, and a general description of how to navigate the project using the "groups, members and iterators" approach is provided here.

Project manipulation methods

The following methods are used to add and import new members to the project.

  • Function AddGeostrophicWind(ByVal Direction As Single, ByVal Speed As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredWindGroup]) As IWind
  • Function AddHeight(ByVal HeightAGL As Single, [ByVal Description As String], [ByVal ParentGroup As IHeightGroup]) As IHeight
  • Function AddMeasuredWind(ByVal Direction As Single, ByVal Speed As Single, ByVal LocationX As Single, ByVal LocationY As Single, ByVal MeasurementHeightAGL As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredWindGroup]) As IWind
  • Function AddReducedGeostrophicWind(ByVal Direction As Single, ByVal Speed As Single, ByVal MeasurementHeightAGL As Single, ByVal MeasurementRoughnessLength As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredWindGroup]) As IWind
  • Function AddSite(ByVal LocationX As Single, ByVal LocationY As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredSiteGroup]) As ISite
  • Function AddTransectSiteGroup(ByVal Description As String, ByVal FirstPointLocationX As Single, ByVal FirstPointLocationY As Single, ByVal SecondPointLocationX As Single, ByVal SecondPointLocationY As Single, ByVal NumberOfSites As Long, [ByVal ParentGroup As IUnstructuredSiteGroup]) As ITransectSiteGroup
  • Function AddUnstructuredSiteGroup(ByVal Description As String, [ByVal ParentGroup As IUnstructuredSiteGroup]) As IUnstructuredSiteGroup
  • Function AddUnstructuredWindGroup(ByVal Description As String, [ByVal ParentGroup As IUnstructuredWindGroup]) As IUnstructuredWindGroup
  • Function ImportObservedExtremeWindClimate(ByVal Filename As String, ByVal LocationX As Single, ByVal LocationY As Single, ByVal Filter As IRveaFileFilter, ByVal ParentGroup As IUnstructuredWindGroup) As IObservedExtremeWindClimate
  • Function ImportObstacleGroup(ByVal Filename As String, ByVal OriginX As Single, ByVal OriginY As Single, [ByVal Filter As IRveaFileFilter], [ByVal ParentSiteGroupMember As ISiteGroupMember]) As IRveaObstacleGroup
  • Function ImportRegionalExtremeWindClimate(ByVal Filename As String, [ByVal Filter As IRveaFileFilter], [ByVal ParentGroup As IUnstructuredWindGroup]) As IRegionalExtremeWindClimate

In each case, the arguments required are naturally similar to the information you need to provide when inserting member to the project in the main GUI.

Where there is an optional parent group argument, this allows you to determine exactly where the new object is insterted. It omitted, the new member will be inserted to the 'root' group (be it winds, sites or heights).

All insertions are done using the project: there are no 'Add' methods on the groups themselves. Conversely, member removal is performed using the group objects rather than the project itself, for example:

CurrentProject.Winds.RemoveMember TargetWind

Advanced properties and methods of the IWengProject interface

These are unlikely to be useful for scripting

  • Property AsIRveaConfigurable As IRveaConfigurable [r/o]
  • Property AsIRveaPreservableObject As IRveaPreservableObject [r/o]
  • Property Class As IWengProjectClass [r/o]
  • Property Configuration As IRveaConfiguration [r/o]
  • Property PersistenceSettings As IProjectPersistenceSettings [r/o]
  • Function InsertPortableSiteGroup(ByVal Group As IRveaPortableSiteGroup, ByVal TargetParent As IPortableSiteGroupReceiver, ByVal DoAddNewHeights As Boolean, ByVal DoAddObstacles As Boolean) As IUnstructuredSiteGroup
  • Sub RedefineDomain(ByVal DomainVectorMapFilename As String, ByVal DomainGridSpecification As IRveaGridMapSpecification, ByVal DomainLatitude As Single, ByVal UseUniformRoughnessLength As Boolean, ByVal UniformRoughnessLength As Single)
  • Sub SubscribeObserverToProjectChanges(ByVal Observer As IProjectChangeObserver)
  • Function ConvertOewcToRewc(ByVal Oewc As IObservedExtremeWindClimate) As IRegionalExtremeWindClimate
  • Sub UnSubscribeObserverToProjectChanges(ByVal Observer As IProjectChangeObserver)


The domain

The project domain

The project domain can be retrieved from the CurrentProject, thus:

Set Domain = CurrentProject.Domain

The domain has the following properties:

  • Property GridSpecification As IRveaGridMapSpecification [r/o]
  • Property Latitude As Single [r/o]
  • Property OrographicGridMap As IRveaRealGridMap [r/o]
  • Property RoughnessGridMap As IRveaRealGridMap [r/o]
  • Property VectorMap As IRveaVectorMap [r/o]

The grid specification describes the rows, columns, resolution and location of the domain. Here's some code from a script writes information about the grid to MSWord.

Set DomainExtent = CurrentProject.Domain.GridSpecification.AsIRveaRectangle
Selection.TypeText (vbCrLf & vbTab & "East-West extension: " & FormatNumber(DomainExtent.MinimumX, 0, -1, 0, 0) & " m to " & FormatNumber(DomainExtent.MaximumX, 0, -1, 0, 0) & " m")
Selection.TypeText (vbCrLf & vbTab & "South-North extension: " & FormatNumber(DomainExtent.MinimumY, 0, -1, 0, 0) & " m to " & FormatNumber(DomainExtent.MaximumY, 0, -1, 0, 0) & " m")
Selection.TypeText (vbCrLf & vbTab & "Resolution: " & FormatNumber(CurrentProject.Domain.GridSpecification.Resolution, 0, -1, 0, 0) & " m")
Selection.TypeText (vbCrLf & vbTab & "Number of points in East-West direction: " & CurrentProject.Domain.GridSpecification.Columns)
Selection.TypeText (vbCrLf & vbTab & "Number of points in South-North direction: " & CurrentProject.Domain.GridSpecification.Rows)

The RoughnessGridMap and the OrographicGridMap can also provide useful information, for example:

MsgBox "The maximum height in the domain grid is: " & CurrentProject.Domain.OrographicGridMap.MaximumValue

If the roughness was specified, rather than being derived from the vector map, it will be uniform over the whole domain. You can test for this using the RoughnessGridMap, thus:

If CurrentProject.Domain.RoughnessGridMap.MinimumValue = CurrentProject.Domain.RoughnessGridMap.MaximumValue Then
MsgBox "Uniform roughness: " & CurrentProject.Domain.RoughnessGridMap.MinimumValue
End If

Changing the domain

If for some reason you wanted to change the domain from a script, you should use a method of the project:

  • Sub RedefineDomain(ByVal DomainVectorMapFilename As String, ByVal DomainGridSpecification As IRveaGridMapSpecification, ByVal DomainLatitude As Single, ByVal UseUniformRoughnessLength As Boolean, ByVal UniformRoughnessLength As Single)

Notice that you need to provide a grid specification. Unless you want the specification to be the same as the existing one, you'll need to create a new one to pass in. See here for instructions about how to do that.


Iterators

Groups, members and iterators

When navigating over the project members, a common approach is used for the sites and winds and heights.

Groups

The heights, sites and winds are all accessed through special interfaces called groups.

Each type of group has its own basic type: ISiteGroup, IHeightGroup, IWindGroup.

In the case of sites and winds, there are different types of group: the basic type is unstructured (IUnstructuredSiteGroup, IUnstructuredWindGroup) but sites can be also be grouped into a transect (ITransectSiteGroup) and winds grouped into climates (roses of winds like IRegionalExtremeWindClimate).

There is only one height group, and the basic type is not called "IUnstructuredHeightGroup".

Members

Each group consists of a collection of group members: ISiteGroupMember, IHeightGroupMember and IWindGroupMember.

Each group member can be either a sub-group or an actual site/height/wind. This allows trees of members to be described. For example, the project has a single unstructured site group which can contain sites, transects and unstructured sub-groups, which can in turn contain other site group members.

A group member can be a sub group, or a site/height/wind. In either case, it still requires some explicit typecasting before its particular properties can be accessed. The TypeCaster object has methods to support this explicit type casting, for example

  • Function CastSiteGroupMemberToSite(ByVal SiteGroupMember As ISiteGroupMember) As ISite
  • Function CastSiteGroupMemberToSiteGroup(ByVal SiteGroupMember As ISiteGroupMember) As ISiteGroup

Iterators

CreateIterator

To get the members of a group, you need to invoke a method on the group called CreateIterator, which returns an iterator object: ISiteGroupIterator, IHeightGroupIterator, IWindGroupIterator, like this:

Set HeightIterator = CurrentProject.Heights.CreateIterator

There is an optional boolean argument in the CreateIterator methods, called CollapseGroupsToList. This defaults to False, but if it's set to True, then the group will return an iterator which contains the group members and its sub-group members recursively. The returned iterator will not include any groups.

For example, if the sites tree in a project looked like this...

... and a script said this...

Set SiteIterator= CurrentProject.Sites.CreateIterator(True)
Msgbox SiteIterator.Count

Then the message box would show the sum of the count of sites in the wind farm, and the transect, and the Ugly restaurant site itself. All of the ISiteGroupMembers contained in the iterator would be of type ISite, and none of them would be ISiteGroup.

Working with iterators

An iterator is a snapshot of a group which lets you examine each member in turn. All iterators have five methods: Count, CurrentMember, FirstMember, IsLastMember and NextMember. Here's an example of the IHeightGroupIterator:

  • Property Count As Long [r/o]
  • Property CurrentMember As IHeightGroupMember [r/o]
  • Property FirstMember As IHeightGroupMember [r/o]
  • Property IsLastMember As Boolean [r/o]
  • Property NextMember As IHeightGroupMember [r/o]

Note that you can't retrieve members by index: these aren't intended to be used with a For... Next loop. The preferred iteration pattern is a Do...Loop like this:

Set HeightGroupMember = HeightIterator.FirstMember
Do While Not HeightGroupMember Is Nothing
'Something or other to work with the height group member...
Set HeightGroupMember = HeightIterator.NextMember
Loop

The properties of the iterator allow a number of different ways to loop, for example:

Set HeightGroupMember = HeightIterator.FirstMember
For Index = 1 to HeightIterator.Count
'Something or other to work with the height group member...
Set HeightGroupMember = HeightIterator.NextMember
Next

or

Set HeightGroupMember = HeightIterator.FirstMember
Do
'Something or other to work with the height group member...
If HeightIterator.IsLastMember Then
Exit Do
End If
Set HeightGroupMember = HeightIterator.NextMember
Loop

When an iterator is created, the CurrentMember is the same as the FirstMember. Invoking NextMember changes the CurrentMember. Any invocation of the FirstMember method will return the CurrentMember reference to the FirstMember. (In other words, it's a reset method for the iterator).

Finding a particular member of a group

If you have a particular, known, group member to which you want to get a reference (this would be unlikely in a generic script, but possibly useful in some circumstances), then you can use the groups' interface method called FindMemberByDescription. All of the groups have a method like this. Here's the ISiteGroup method:

Function FindMemberByDescription(ByVal Description As String, [ByVal DoRecursiveSeek As Boolean = True]) As ISiteGroupMember

Note the DoRecursiveSeek optional argument. This is useful if there's a big tree of groups and group members, and you don't have a reference to the parent group.


The winds in a project

The winds in a project are arranged in a collection of reduced geostrophic winds. The root wind group can be retrieved from the project thus:

Set Winds = CurrentProject.Winds

This returns an IUnstructuredWindGroup object. See the section called "Groups, members and iterators" for a general explanation of how groups are used.

Winds

In WEng 3.0, the root wind group contains only reduced geostrophic winds. Reduced geostrophic winds have type IReducedGeostrophicWind.

  • Reduced geostrophic winds
    These winds are brought down from geostrophic height to some standard local conditions expressed as a roughness length and height (usually 0.05m and 10m respectively). The interface is IReducedGeostrophicWind.

Source winds

A reduced goestrophic wind may have been sourced from one of two other types of winds:

  • Measured winds
    These are site-located speed and directions. The interface is IMeasuredWind.
  • Geostrophic winds
     Just a speed and direction for geostophic height. The interface is IGeostrophicWind.

Getting the winds

You can retrieve and work with an iterator for all the winds in a project by using the CreateIterator method.

Set WindsIterator = Winds.CreateIterator(True)
Set WindGroupMember = WindsIterator.FirstMember
Do While Not WindGroupMember Is Nothing
Set RgWind = TypeCaster.CastWindToIReducedGeostrophicWind(WindGroupMember)
MsgBox RgWind.Description
Set WindGroupMember = WindsIterator.NextMember
Loop

Note the use of the TypeCaster object to cast from the more generic IWindGroupMember interface to the more specific interface.

The IEditableWind interface

All three wind types can be cast to the IEditableWind interface. This interface provides the following:

  • Property IsEditable As Boolean [r/o]
  • Property Description As String [r/w]
  • Property Direction As Single [r/o]
  • Property Speed As Single [r/o]

Wind results

It's the reduced geostrophic winds which are used to return results from the project (see another section for more information) via the Results property:

  • Property Results(ByVal GridSelection As IDataSelection, [ByVal Height As IHeight]) As IWindResults[r/o]

The Results structure contains the following properties which represent calculation results.

  • Property GridResult(ByVal GridSelection As IDataSelection, [ByVal Height As IHeight]) As IRveaRealGridMap [r/o]
  • Property PointResult(ByVal DataSelection As IDataSelection, ByVal Site As ISite, [ByVal Height As IHeight]) As Single [r/o]
  • Property Turbulence(ByVal Site As ISite, ByVal Height As IHeight, ByVal SpectrumType As eTurbulenceSpectrumType) As ITurbulence [r/o]
  • Property MinimumCharnockFetch As Single [r/o]
  • Property UpwindVelocityDerivatives(Site As ISite, Height As IHeight) As IRveaUpwindVelocityDerivatives[r/o]

The standard reduced geostrophic wind properties describe how WEng is modelling the wind internally. For a reduced geostrophic wind with standard properties, these values are the same as the speed and direction values in the basic information.

What kind of wind is a wind?

If you have an IWind reference and you want to discover what kind of wind it is, the only way is to try type casting it explicitly to a particular type and checking whether the return value is Nothing.

Set MeasuredWind = TypeCaster.CastWindToIMeasuredWind(Wind)
If MeasuredWind is Nothing then
MsgBox (Wind.Description & " is not a measured wind")
End if

Editing the winds

Each of the three wind interfaces has an Edit method, which takes arguments as appropriate to its type. However, not all winds are actually editable. You can check before trying to make an edit by using a property on the IEditableWind interface called IsEditable, which returns a boolean value.

Set RgWind = TypeCaster.CastWindToIReducedGeostrophicWind(Wind)
Set Editable = TypeCaster.CastWindToIEditableWind(Wind)
If not Editable Is Nothing then
If Editable.IsEditable Then
RgWind.Edit 270,23.4,10,0.05,"Edited wind"
End If
End If

Adding and removing a new wind

New winds can be added using functions of the IWengProject interface, like this:

Set Winds = CurrentProject.Winds
Set NewWind = CurrentProject.AddGeostrophicWind (192,60,"High and fast")
MsgBox NewWind.StandardReducedGeostrophicWindSpeed

This will actually add the new wind to the currently open project, so if you want that to be a temporary addition, then you need to remove the wind again explicitly, like this:

Winds.RemoveMember NewWind

Interacting with the GUI selections

The selection context in which the script runs may let you get a reference to the currently-selected wind. This is provided by the following wind object:

  • CurrentWindGroupMember (IWindGroupMember)

The TypeCaster methods can be used to get more precise type information from these generic objects. For example, you can try to typecast the CurrentWindGroupMember object to a IReducedGeostrophicWind object.

If no wind or climate is currently selected, then the objects will return 'Nothing'. Remember that your script can declare its selection requirements to the GUI, and will not be executed unless the right combination of objects is selected.


Extreme wind climates

The extreme wind climates in a project are arranged in a list of regional extreme wind climates. The climate list can be retrieved from the project thus:

Set Climates = CurrentProject.Climates

This returns an IExtremeWindClimateList object. See the section called "Groups, members and iterators" for a general explanation of how lists are used.

Regional Extreme Wind Climates

In WEng 3.0, the members of the extreme wind climate (REWC) list are regional extreme wind climates with type IRegionalExtremeWindClimate. The regional extreme wind climate may be derived from an observed wind climate, type IObservedExtremeWindClimate. The regional climate has information about the standard conditions which apply to its wind data. The observed climate has some basic information about the met. station from which the observations were collected. Neither type of climate can be edited. The properties of each are set when imported from file, or when calculated.

Apart from these differences, both climates have a similar set of methods and also implement a common, generic, interface called IGenericExtremeWindClimate.

  • Property AsIWindGroup As IWindGroup [r/o]
  • Property AsIWindGroupMember As IWindGroupMember [r/o]
  • Property Description As String [r/o]
  • Property ExtremeWindRose As IExtremeWindRose [r/o]
  • Property SourceDataSouvenir As IRveaSourceDataSouvenir [r/o]
  • Function ApplyToPoint(ByVal Site As ISite, ByVal Height As IHeight) As IRveaExtremeWindRose

Scatter plot, extreme winds

The climates in WEng 3.0 no longer contain component winds, the data are recorded as a scatter plot sequence IRveaExtremeWindSpeedScatterPlotSequence. The scatter plot sequence provides access to the extreme wind speed sequence and Gumbel distribution, which gives the maximum expected wind speed from any direction.

Set ScatterSequence = Rewc.ScatterPlotSequence
Set ExtremeWindSequence = ScatterSequnce.AsSpeedSequence
MsgBox ExtremeWindSequence.GumbelDistribution.GetMaximumSpeedForInterval(25)

Applying a REWC

A regional extreme wind climate can be applied to a particular site, just as it can from the GUI. The result is a predicted extreme wind climate IPredictedExtremeWindClimate. The following code applies the currently selected regional extreme wind climate to a site at a particular height and then displays the 25 year extreme wind.

Set PredictedClimate = CurrentProject.ApplyRewcToPoint(Rewc, Site, Height)
MsgBox PredictedClimate.ScatterPlotSequence.AsSpeedSequence.GumbelDistribution.GetMaximumSpeedForInterval(50)

Analysing a climate: calculating REWC from OEWC

Added an observed wind climate to a project will result in the creation of uncalculated REWC in the climates list. The following function will calculate the REWC based on the OEWC:

  • Sub CalculateRewc(Rewc As IRegionalExtremeWindClimate)

So the code to do it looks like this:

Rewc = CurrentProject.CalculateRewc(Rewc)


Sites

Getting the sites

The sites in a project are arranged in a tree of sites and site groups. The root site group can be retrieved from the project thus:

Set Sites = CurrentProject.Sites

This returns an IUnstructuredSiteGroup object. See the section called "Groups, members and iterators" for a general explanation of how groups are used.

Site group nesting

Site groups can be nested: each unstructured site group can contain sites and other site groups, thus:

You can get a 'flat' list of all the sites in a project, you can use the CreateIterator method of the project's root site group

Set SiteIterator = CurrentProject.Sites.CreateIterator(True)

Alternatively, if you pass False to the CreateIterator method, you'll get a non-recursively-collected set of sites and site groups. You can use the TypeCaster object to work out what kind of member is being returned from the iterator as you work through the members, like this:

Set SiteIterator = CurrentProject.Sites.CreateIterator(False)
Set OneSiteGroupMember = SiteIterator.FirstMember
Do While Not OneSiteGroupMember is Nothing
If Not TypeCaster.CastSiteGroupMemberToSiteGroup(OneSiteGroupMember) is Nothing Then
If Not TypeCaster.CastSiteGroupMemberToTransect(OneSiteGroupMember) is Nothing Then
MsgBox "Transect with name: " & OneSiteGroupMember.Description
Else
MsgBox "Site group with name: " & OneSiteGroupMember.Description
End if
Else
MsgBox "Site with name: " & OneSiteGroupMember.Description
End if
Set OneSiteGroupMember = SiteIterator.NextMember
Loop

The code above will pop up three messageboxes:

  • Site with name: Ugly restaurant
  • Transect with name: Ski lift
  • Site group with name: WaspvalePark wind farm

Note that the nested site group 'Untitled' is not included in the iterator members, because it's a child of the 'WaspvalePark wind farm' group.

Finding a site group member by description

The FindMemberByDescription method is most useful in the sites tree because it's the sites which can be deeply nested. Of course it's only useful where you know about the project members a priori. For example, if you know/suspect that there's a transect called 'Ski lift' in the project, you can get a reference to it without iterating over all the members:

Set OneSiteGroupMember = CurrentProject.Sites.FindMemberByDescription("Ski lift")
If Not OneSiteGroupMember Is nothing then
Set Transect = TypeCaster.CastSiteGroupMemberToTransect(OneSiteGroupMember)
If Not Transect Is Nothing Then
Msgbox "Transect sites separated by " & Transect.IntersiteDistance & "m"
End If
End if

Adding site groups and sites to the project

To add a new ad-hoc site, you must use a method of the project, not the project sites group to which you want to add it. If you want the site to be added to a particular group other than the root group, you can specify a reference to that as an optional argument:

Function AddSite(ByVal LocationX As Single, ByVal LocationY As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredSiteGroup]) As ISite
Function AddUnstructuredSiteGroup(ByVal Description As String, [ByVal ParentGroup As IUnstructuredSiteGroup]) As IUnstructuredSiteGroup
Function AddTransectSiteGroup(ByVal Description As String, ByVal FirstPointLocationX As Single, ByVal FirstPointLocationY As Single, ByVal SecondPointLocationX As Single, ByVal SecondPointLocationY As Single, ByVal NumberOfSites As Long, [ByVal ParentGroup As IUnstructuredSiteGroup]) As ITransectSiteGroup

You could use the methods like this:

Set OneSiteGroup = CurrentProject.Sites.FindMemberByDescription("WaspvalePark wind farm")
Set NewSiteGroup = CurrentProject.AddUnstructuredSiteGroup("NewGroup", OneSiteGroup)
Set NewSite = CurrentProject.AddSite( 32000,39000,"FoobarNewSite", NewSiteGroup )
Set NewTransect = CurrentProject.AddTransectSiteGroup("StringOfSites ", 32100, 39100, 33100, 40100, 10, NewSiteGroup)

You cannot add a site to a transect in the same way: you need to edit the transect itself.

Editing a site or transect

Sites can be edited or moved. The only difference between the two operations is that editing allows the description to be changed too.

Set Site = TypeCaster.CastSiteGroupMemberToSite(CurrentProject.Sites.CreateIterator(True).FirstMember)
Site.Edit 31565,37500,"Ballon landing site"

To edit a transect, you can move the end sites, and change the total number of sites. The other properties of the transect are emergent/derived, and are read-only (apart from the description).

Set OneSiteGroupMember = CurrentProject.Sites.FindMemberByDescription("Ski lift")
Set Transect = TypeCaster.CastSiteGroupMemberToTransect(OneSiteGroupMember)
Set EndSite = Transect.OneEndSite
EndSite.Move 25000,31000
Set EndSite = Transect.OtherEndSite
EndSite.Move 26000,35000
Transect.NumberOfSites = 7

Interacting with the GUI selections

The selection context in which the script runs may let you get a reference to the currently-selected site, site group or transect.

  • CurrentSite (ISite)
  • CurrentSiteGroup (ISiteGroup)
  • CurrentTransect (ITransectSiteGroup)

If no site or site group or transect is currently selected, then the object will return 'Nothing'. Remember that your script can declare its selection requirements to the GUI, and will not be executed unless the right combination of objects is selected.


Heights

Getting the heights

The project has a simple, unstructured group of heights (IHeightGroup), which you can retrieve thus:

Set Heights = CurrentProject.Heights

Through the scripting interfaces, it's actually possible to set up a tree of sub-groups, but the main WEng GUI program doesn't support those, so that's not a good idea.

To access each height, you need to iterate over the heights group as for other objects.

Set HeightIterator = Heights.CreateIterator(True)
Set HeightGroupMember = HeightIterator.FirstMember
Do While Not HeightGroupMember Is Nothing
Set Height = TypeCaster.CastHeightGroupMemberToHeight(HeightGroupMember)
Msgbox Height.Description & " (" & Height.HeightAGL & "m)"
Set HeightGroupMember = HeightIterator.NextMember
Loop

Note that the iterator methods (FirstMember, NextMember) return generic IHeightGroupMember objects, which need to be type cast to an IHeight object.

Adding, editing and removing heights

To add a height, you must use a method of the project, not the project heights group.

Function AddHeight(HeightAGL As Single, [Description As String], [ParentGroup As IHeightGroup]) As IHeight

For example:

Set NewHeight = CurrentProject.AddHeight(10.65,"Top of the barn")

(Don't use the ParentGroup argument.)

You can edit the height's properties.

NewHeight.Edit 10.94,"Barn's wind vane's crow's beak"

To remove a height, you need to call a method of the height group, and pass a reference to the doomed height object.

CurrentProject.Heights.RemoveMember(NewHeight)

Interacting with the GUI selections

The selection context in which the script runs may let you get a reference to the currently-selected height.

  • CurrentHeight (IHeight)

If no height is currently selected, then the object will return 'Nothing'. Remember that your script can declare its selection requirements to the GUI, and will not be executed unless the right combination of objects is selected.


Results

Reading results data

Results come from the winds

You always need to work with a wind object to get results. Results 'belong' to the winds.

To retrieve a result, you need to specify for which height and site you would like to get results, and which variable you're interested in. For example..

MsgBox (Wind.PointResult(DataSelection, Site, Height))

Note that heights and sites have no corresponding methods for getting results (for which you would specify a wind), so you can't use this:

MsgBox (Site.PointResult(DataSelection, Wind, Height)) 'This won't work!

The DataSelection argument is explained in another section.

Three kinds of results: grids, points and turbulence

Grid map results

To retrieve one of these, you use a property called GridResult ...

Set Grid = Wind.GridResult(DataSelection,Height)

... which returns an IRveaRealGridMap object.

MsgBox Grid.MaximumValue

There's no need to specify a site for grid: just a height and a selector to indicate which results you want to retrieve. Note that the height is an object reference: not a value in metres.

Point results

This returns a single-precision value, not an object.

MsgBox (Wind.PointResult(DataSelection, Site, Height))

You need to specify which site (x-y) as well as which height (z). Note that the height is an object reference: not a value in metres.

Tubulence results

This returns an ITurbulence object, which has various properties and methods. They are described in more detail in another section.

To retrieve a turbulence object, you need to specify a height, a site and a spectrum type.

Set Turbulence = Wind.Turbulence(Site, Height, SpectrumType)

The spectrum type is an enum, defined in Rvea0027.tlb:

tstKWIC = 0 'Kaimal
tstSimuiScanlan=1 'Simiu and Scanlan
tstESDU=2 'EDSU

You can set these up as contstants in your script, to make the code more readable.

Const tstKWIC = 0, tstSimuiScanlan= 1, tstESDU= 2
Set Turbulence = Wind.Turbulence(Site,Height, tstESDU)

Remember that there are some constraints on the calculation of an ESDU turbulence result.

  • If the height is greater than 180 metres then the wind speed must be greater than 15 m/s
  • The wind speed must be between 10 and 80 m/s
  • The height must be between 5 and 300 m
  • The site roughness length must be between 0.0001 and 1.0m

The GUI enforces these restrictions when running in the main program, but when scripting you need to observe them yourself. An error will arise if you violate the constraintgs.

There's no 'Calculate' method

In WEng, results are calculated on-demand. There is no need to request explicitly a calculation. If you try to retrieve the results, a calculation will automatically be peformed if the results are missing or out of date.


Selectors

Point results and grid maps of results can be retrieved from the project space. In either case, a general-purpose method is used.

  • Property GridResult(ByVal GridSelection As IDataSelection, [ByVal Height As IHeight]) As IRveaRealGridMap [r/o]
  • Property PointResult(ByVal DataSelection As IDataSelection, ByVal Site As ISite, [ByVal Height As IHeight]) As Single [r/o]

The GridSelection/DataSelection argument is used to specify which variable is required. The IDataSelection argument is an object, not an enum value. So, before invoking one of these methods, you need to obtain a reference to the right IDataSelection.

How to get a data selection object

Getting a list of data selections

The dataselection objects belong to the project meta-class (IWengProjectClass)

Property DataSelectionLists As IDataSelectionLists [r/o]

That sounds complicated, but the code is simple. You can get the project class in two ways:

Set TheProjectClass = CreateObject("Rvea0081.Rvea0081Classes").WengProjectClass

...or...

Set TheProjectClass = CurrentProject.Class

Then you just retrieve the datalists like this:

Set DataLists = TheProjectClass.DataSelectionLists

The IDataSelection lists has three properties

Property AllSelections As IDataSelectionList [r/o]
Property GridSelections As IDataSelectionList [r/o]
Property SiteSelections As IDataSelectionList [r/o]

Getting a data selection from a list

When you've got the dataselection list, you can retrieve individual IDataSelection objects. Usually, you just use an enum to get the one you want, with the ItemByID method:

Set GridSelections = DataLists.GridSelections
Property ItemByID(ID As eDataSelectionID) As IDataSelection

The Enum eDataSelectionID

  • edvElevation As Long=1
  • edvRoughness As Long=2
  • edvDynamicRoughness As Long=3
  • edvFetch As Long=4
  • edvFrictionVelocity As Long=5
  • edvTerrainInclination As Long=6
  • edvSpeed As Long=7
  • edvVelocityXComponent As Long=8
  • edvVelocityYComponent As Long=9
  • edvVelocityZComponent As Long=10
  • edvDirection As Long=11
  • edvHorizontalSpeed As Long=12
  • edvShelteredSpeed As Long=13
  • edvVelocityTilt As Long=14
  • edvdUdx As Long=15
  • edvdUdy As Long=16
  • edvdUdz As Long=17
  • edvdVdx As Long=18
  • edvdVdy As Long=19
  • edvdVdz As Long=20
  • edvdWdx As Long=25
  • edvdWdy As Long=26
  • edvdWdz As Long=27
  • edvdTiltdx As Long=21
  • edvdTiltdy As Long=22
  • edvdTiltdz As Long=23
  • edvAlpha As Long=24

The ID argument needs to be explicit

As explained in another section, enumeration values and constants don't work in the scripting context. One way round this is just to use the actual value in-line:

Set Dataselection = DataSelectionLists.AllSelections.ItemByID(12) 'edvHorizontalSpeed

Alternatively, the TypeCaster object offers a safe set of values you can use.

Set DataSelection = DataSelectionLists.AllSelections.ItemByID(TypeCaster.idForElevation)

A concise version

All this can be collapsed into a single line

Set DataSelection=CurrentProject.Class.DataSelectionLists.AllSelections.ItemByID(TypeCaster.idForElevation)

Other ways to use a data selection

The IDataSelection has properties which you can use to investigate the object at run-time.

  • Property Description As String [r/o]
  • Property FlagValue As Single [r/o]
  • Property FormatString As String [r/o]
  • Property IsAvailableAsGrid As Boolean [r/o]
  • Property IsAvailableForSite As Boolean [r/o]
  • Property RequiresHeightContext As Boolean [r/o]
  • Property RequiresWindContext As Boolean [r/o]
  • Property ShortDescription As String [r/o]
  • Property Units As String [r/o]

Two sets: selections for grids and selections for sites

It's clear from the foregoing discussion that there are two sets of data selections: one for grids and one for sites. There's a large intersect, though: many of the selections belong to both sets.

The table below lists all the selections and shows where they belong.

Description | Site ? | Grid ?
Elevation | X | X
Roughness | X | X
Dynamic roughness | X | X
Fetch | X | X
Friction velocity | X | X
Terrain inclination | X | X
Speed |  | X
Velocity 'x' component |  | X
Velocity 'y' component |  | X
Velocity 'z' component |  | X
Direction | X |
Horizontal speed | X |
Sheltered speed | X |
Velocity tilt | X | X
dU/dx | X | X
dU/dy | X | X
dU/dz | X | X
dV/dx | X | X
dV/dy | X | X
dV/dz | X | X
dTilt/dx | X |
dTilt/dy | X |
dTilt/dz | X |
Alpha | X |
dW/dx |  | X
dW/dy |  | X
dW/dz |  | X

Some results don't require a height to be selected.

A frequent source of confusion and errors

This is often confusing when writing a script, because the enum which you pass in to get a data selection is not typed by grid or site.

We've noticed that the Speed and HorizontalSpeed are the most confusing. Speed is a grid-only value, and HorizontalSpeed is a point-only value.

If you get mixed up, then your script will throw an error. For example, if you ask for a grid-only selector from the sites list, you'll get an error.

Msgbox(Lists.SiteSelections.ItemByID(TypeCaster.IdForSpeed).Units) 'Speed only applies to grids

Alternatively, if you get a legitimate data selection, but then pass it to the wrong results method, you'll see an error too, or perhaps just get a zero when you're expecting a value.

Improvements

We should be able to make some improvements to the object model to make this less difficult and confusing.


Turbulence

I am not a number ...

A turbulence result for a site is an object, not a number. The spectrum type is specified when the turbulence object is retrieved from the wind.

Set Turbulence = Wind.Turbulence(Site, Height, SpectrumType)

The result is a reference to an ITurbulence interface, which has four properties:

Spectrum type

This simply returns the type of spectrum (the same value as was passed in when it was calculated)

Property SpectrumType As eTurbulenceSpectrumType [r/o]

Sigma

This returns a single-precision float. You need to specify two components.

Property Sigma(ByVal FirstComponent As eTurbulenceVelocityComponent, ByVal SecondComponent As eTurbulenceVelocityComponent) As Single [r/o]

Each component can be U,V or W, so there are nine different ways to retrieve sigma (UU,UV,UW,VV,VU,VW,WW,WU,WV). The component choice is defined as an enum:

  • etvcU As Long=1
  • etvcV As Long=2
  • etvcW As Long=3

As explained in another section, enumeration values and constants don't work in the scripting context. One way round this is just to use the actual value in-line:

MsgBox Turbulence.Sigma(1,1)

Alternatively, you can use the TypeCaster object's constants.

  • Property IdForVelocityComponentU As Long [r/o]
  • Property IdForVelocityComponentV As Long [r/o]
  • Property IdForVelocityComponentW As Long [r/o]

Like this:

MsgBox Turbulence.Sigma(TypeCaster.IdForVelocityComponentU,TypeCaster.IdForVelocityComponentU)

Spectrum and cross-spectrum

These methods return the turbulence spectra.

Property Spectrum(ByVal FirstComponent As eTurbulenceVelocityComponent, ByVal SecondComponent As eTurbulenceVelocityComponent, ByVal k1Min As Single, ByVal k1Max As Single, ByVal k1Step As Single) As ITurbulenceSpectrum [r/o]

Property CrossSpectrum(ByVal FirstComponent As eTurbulenceVelocityComponent, ByVal SecondComponent As eTurbulenceVelocityComponent, ByVal k1Min As Single, ByVal k1Max As Single, ByVal k1Step As Single, ByVal dy As Single, ByVal dz As Single) As ITurbulenceCrossSpectrum [r/o]

The velocity components need to be specified as for sigma (above). The other arguments correspond exactly to the advanced settings in the main program...

k1Min is Lower limit; L1Max is Upper limit; k1Step is Points per decate; dy is Traverse separation; dz is Vertical separation


SourceFileTraces

Source file traces in WEng

A source file trace is a little souvenir item which remembers each file that's imported into the project. It remembers the file name, and path, and the imported time, and the last modified time of the file when it was imported. Every time that a WEng project is opened, the program checks through the source file traces. If it can still find the file, then it compares the last modified times, and issues a warning if the file has been updated since it was imported.

These source file traces are also available to the scripts as objects, and can be useful when defining the complete context of the results being reported.

Getting the source file trace

The project has a collection of source file traces which you can retrieve as a property.

Property SourceFileTraces As ISourceFileTraces

You can iterate over the collection using a For... Next loop and get a reference to one trace at a time.

Set Traces = CurrentProject.SourceFileTraces
For Index = 1 to Traces.Count
Set OneTrace = Traces.SourceFileTrace(Index)
MsgBox OneTrace.OriginalName
MsgBox OneTrace.ModifiedTime
Next

You can also retrieve the source file trace for a particular object, thus:

Set OneTrace = Traces.SourceFileTraceForObject(CurrentProject.Domain.VectorMap)


Type casting

The problem with interface casting

Type casting interfaces is a problem in scripts. Because the variables are untyped, you cannot make an implicit type cast and the language does not support explicit type casts. If you have an object variable (more properly described in COM as interface pointer), which has been assigned to a particular type of interface, then it cannot subsequently be assigned to another one.

For example, if you have a variable called 'Foo', and you make the following assignment ...

Set Foo = CurrentProject.Winds

... then Foo will be a pointer to an IUnstructuredWindsGroup. Even though we know that the object returned by CurrentProject.Winds also implements other interfaces, such as IWindGroupMember, there is no immediate way to get access to those other interfaces.

In VB, or VBA, you could do an implicit typecast, like this ...

Dim Bar as IWindGroupMember

... then you could use Bar to access the methods from the IWindGroupMember interface. But you can't do that in VBScript.

In .NET and other more complete OO languages, you could make an explicit typecast, like this ...

Set Bar = CType(Foo, IWindGroupMember)

... but you can't do that in VBScript either.

The solutions

There are two ways to get round this problem: 'built-in' typecasting methods, and external type casting methods.

Built-in methods

Explict typecast methods can be added to some of the interfaces. This is generally useful for normal coding, but is only used when the relationship between the interfaces is well known and the need to make the type cast arises often. For example, the IHeight interface has a property called AsIHeightGroupMember, which returns a pointer to an IHeightGroupMember interface. So, if you've got a variable of type IHeight, then you know for sure that it implements the IHeightGroupMember interface, and you can access the methods of the IHeightGroupMember interface by using the typecast property, or by setting a new variable to that interface. Here's an example using wind groups:

Set EWC = CurrentEwc
Set WindGroup = EWC.AsIWindGroup
Set WindGroupIterator =WindGroup.CreateIterator
CountOfWinds = WindGroupIterator.Count

Set EWC = CurrentEwc
CountOfWindws = EWC.AsIWindGroup.CreateIterator.Count

Note that this only works correctly if you have not previously used the WindGroup variable for any other type of object. The type of a variable is determined the first time it's assigned to something, and stays the same thereafter.

External methods

The second approach is externally to provide some specific methods which can be invoked to make an explicit type cast. This has the advantage of allowing the code to type cast to a more specific type (for example from a WindGroupMember to an ObservedExtremeWindClimate). The 'built-in' type caster methods described above can only go from a more specific to a less specific type. There's an object available to the scripts which provides a collection of such methods, called the TypeCaster.

The TypeCaster object methods

The TypeCaster object is globally available to the scripts, as part of the script execution context. The scripts can just make an immediate reference to the TypeCaster, without having to create it explicitly.

Here is a list of the the publicly-available methods offered by the TypeCaster:

  • Function CastHeightGroupMemberToHeight(ByVal HeightGroupMember As IHeightGroupMember) As IHeight
  • Function CastObjectToRveaRveaPreservableObject(ByVal SourceObject As Object) As IRveaPreservableObject
  • Function CastObjectToExportableProjectMember(ByVal SourceObject As Object) As IExportableProjectMember
  • Function CastSiteGroupMemberToSite(ByVal SiteGroupMember As ISiteGroupMember) As ISite
  • Function CastSiteGroupMemberToSiteGroup(ByVal SiteGroupMember As ISiteGroupMember) As ISiteGroup
  • Function CastSiteGroupMemberToTransect(ByVal SiteGroupMember As ISiteGroupMember) As ITransectSiteGroup
  • Function CastWindGroupMemberToGenericEwc(ByVal WindGroupMember As IWindGroupMember) As IGenericExtremeWindClimate
  • Function CastWindGroupMemberToOewc(ByVal WindGroupMember As IWindGroupMember) As IObservedExtremeWindClimate
  • Function CastWindGroupMemberToRewc(ByVal WindGroupMember As IWindGroupMember) As IRegionalExtremeWindClimate
  • Function CastWindGroupMemberToWind(ByVal WindGroupMember As IWindGroupMember) As IWind
  • Function CastWindGroupMemberToWindGroup(ByVal WindGroupMember As IWindGroupMember) As IWindGroup
  • Function CastWindToIGeostrophicWind(ByVal WengWind As IWind) As IGeostrophicWind
  • Function CastWindToIMeasuredWind(ByVal WengWind As IWind) As IMeasuredWind
  • Function CastWindToIReducedGeostrophicWind(ByVal WengWind As IWind) As IReducedGeostrophicWind
  • Function GetTemporaryFileName() As String

Note that there is one extra helper function at the end of the list: "GetTemporaryFileName". This just does what it says: it returns a temporary filename. The TypeCaster object also provides some constants which are discussed in a separate topic.

Using these type casting methods is straightforward.

Set EWC = TypeCaster.CastWindGroupMemberToOewc(WindGroup)

If the object passed in as the argument to the casting method is of the wrong type, then an error will be thrown and the script will terminate. In the above example, the WindGroup object must be of type IWindGroupMember.

If the object passed in is Nothing, or is not of the correct return type, then the method returns Nothing. In the above example, if the WindGroup object is not of type IObservedExtremeWindClimate, then no error will be thrown, but Nothing will be returned.


Constants

The problem with constants

Trying to use constants in scripts gives rise to similar problems as with type casting. If you haven't used the Option Explicit directive, VBScript doesn't support them well. It will accept the appearance of one without raising a syntax error, treating it as an unassigned variable. This is a problem for WEng scripting because various enumerations (sets of named constants) are used to select results for retrieval.

If you try to use the constants declared in the ProjectSpace type library, it won't work. For example

Set VelocityTiltDataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(edvVelocityTilt)

The script will run, but edvVelocityTilt will be evaluated as zero, and then an error will be thrown when getting the data selection.

Some solutions

There are a couple of ways around this. The first, and most obvious, is to look up the integer value equivalent and use that in the script, like this...

Set VelocityTiltDataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(14) 'edvVelocityTilt

... but hard-coded constant values like that make the code difficult to understand. A better approach is to declare the constant at the top of the script.

edvVelocityTilt = 14

...

Set VelocityTiltDataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(14) 'edvVelocityTilt

This approach is useful for windows-specific constants like these

Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0

The TypeCaster object constants

To simplify the script coding, some constants are the TypeCaster object (which is always in scope while the scripts execute). These can then be safely referenced in the scripts themselves.

Here is a list of the available constants...

  • Property IdForAlpha As Long [r/o]
  • Property IdForDirection As Long [r/o]
  • Property IdFordTiltdx As Long [r/o]
  • Property IdFordTiltdy As Long [r/o]
  • Property IdFordTiltdz As Long [r/o]
  • Property IdFordUdx As Long [r/o]
  • Property IdFordUdy As Long [r/o]
  • Property IdFordUdz As Long [r/o]
  • Property IdFordVdx As Long [r/o]
  • Property IdFordVdy As Long [r/o]
  • Property IdFordVdz As Long [r/o]
  • Property IdFordWdx As Long [r/o]
  • Property IdFordWdy As Long [r/o]
  • Property IdFordWdz As Long [r/o]
  • Property IdForDynamicRoughness As Long [r/o]
  • Property IdForElevation As Long [r/o]
  • Property IdForFetch As Long [r/o]
  • Property IdForFrictionVelocity As Long [r/o]
  • Property IdForHorizontalSpeed As Long [r/o]
  • Property IdForRoughness As Long [r/o]
  • Property IdForShelteredSpeed As Long [r/o]
  • Property IdForSpeed As Long [r/o]
  • Property IdForTerrainInclination As Long [r/o]
  • Property IdForVelocityComponentU As Long [r/o]
  • Property IdForVelocityComponentV As Long [r/o]
  • Property IdForVelocityComponentW As Long [r/o]
  • Property IdForVelocityTilt As Long [r/o]
  • Property IdForVelocityXComponent As Long [r/o]
  • Property IdForVelocityYComponent As Long [r/o]
  • Property IdForVelocityZComponent As Long [r/o]

So you can simply write ...

Set VelocityTiltDataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(IdForVelocityTilt )


SavingProjectMembers

Saving (exporting) project members

If you want to save a project member to file, then you can export it from the project.

Some project members implement an interface called IExportableProjectMember. Here are the members of the interface:

Property IsReadyToExport As Boolean [r/o]
Property PreservableClass As IRveaPreservableClass [r/o]
Sub Export(ByVal Filename As String, [ByVal FileFilter As IRveaFileFilter = 0], [ByVal DoReassignSourceFileTrace As Boolean = False])

You can use the TypeCaster object to make a type cast from the particular project member to the IExportableProjectMember interface (WEng 2.0 E and later). For example:

Set VectorMap = CurrentProject.Domain.VectorMap
Set ExportableThing = TypeCaster.CastObjectToExportableProjectMember(VectorMap)

If the project member doesn't support the IExportableProjectMember interface, then Nothing will be returned.

If Not ExportableThing Is Nothing Then
If ExportableThing.IsReadyToExport Then
ExportableThing.Export ("c:\foo.map")
End If
End If

The IsReadyToExport property can be false for some object which may require calculation before they have any data for writing to file.

Advanced export techniques

Using the IRveaPreservableObject interface

If the object implements the IRveaPreservableObject interface, then you can use the TypeCaster object to get a reference.

TypeCaster.CastObjectToRveaPreservableObject(CurrentProject.Domain.VectorMap)

You can read more about how to work with the IRveaPreservableObject interface in another section.

Using the other arguments in the Export method

The Export method also accepts an optional FileFilter argument. How to obtain and use a file filter is explained in another section, but note here that the IExportableProjectMember interface has a property PreservableClass, which can be useful for getting the file filters.

Set PreservableClass = ExportableThing.PreservableClass
Set Filters = PreservableClass.SavingFileFilters

TheExportmethod also has an optional boolean argument calledDoResassignSourceFileTrace . This controls whether the WEng project accepts this file save as the latest up-to-date version of the file. Normally, this will befalsefrom a scripting context. If you use this and want the project to remember the change, then you need to save the project either from within the script, or from the main GUI after the script has executed.


GuidedTours

Guided script tours

In this section, we look at the full contents of some example scripts, providing a brief explanation of what's going on in each part of the code.


The detailed site and wind report

Here's a walk-through of one of the standard scripts supplied with WAsP Engineering 2.0

Script contents | Remarks
<?xml version="1.0" encoding="UTF-8"?>
 The standard XML processing instruction
<RveaWengInternalScript MinimumApplicationVersion="02.00.0015" CurrentApplicationVersion="02.00.0015" FormatVersion="01.01.0001" Description="Detailed site report for one site, one wind and one height">
 The root script element, containing the description which will appear in the WEng menu
<ScriptType>WordReport</ScriptType> | The script type element, declaring that this script will need MS Word. The script will be disabled in the WEng menu if Word is not found on the computer.
<RequiredProjectSelection>epmtWind</RequiredProjectSelection>
<RequiredProjectSelection>epmtSite</RequiredProjectSelection>
<RequiredProjectSelection>epmtHeight</RequiredProjectSelection> 		The required project selection elements, which explain which items in the project hierarchy trees must be unambiguously selected in order for the script to execute. WEng will disable the script in the menu if the right combination of objects is not selected
<Comment>Produces a Word document with a detailed site report</Comment>
<ScriptCode><![CDATA[

Sub Main() 		The script code element begins, opening a CDATA block to contain the VBScript code. Sub Main() is the first line of code.
'Some useful objects
Set TheProjectClass = CreateObject("Rvea0081.Rvea0081Classes").WengProjectClass 		The project meta-class is used to retrieve the DataSelector objects. An alternative would be to use the CurrentProject.Class property.

'Enforce the requirement (1 winds)
Set WindGroupMember = CurrentWindGroupMember
Set Wind = TypeCaster.CastWindGroupMemberToWind(WindGroupMember)
If Wind Is Nothing Then
MsgBox "This report requires that at exactly one wind is selected. " & vbCrLf & vbCrLf & "Please select a wind and try again.", , "Cannot produce report with the current project"
Exit Sub
End If

'Enforce the requirement (1 sites)
Set Site = TypeCaster.CastSiteGroupMemberToSite(CurrentSite)
If Site Is Nothing Then
MsgBox "This report requires that exactly one site is selected." & vbCrLf & vbCrLf & "Please select one and try again.", , "Cannot produce report with the current project"
Exit Sub
End If

'Enforce the height selection requirement
Set WorkingHeight = TypeCaster.CastHeightGroupMemberToHeight(Currentheight)
If WorkingHeight Is Nothing Then
MsgBox "This report requires that a height is selected." & vbCrLf & vbCrLf & "Please select one and try again.", , "Cannot produce report with the current selections"
Exit Sub
End If
 This block of code checks that the 1 wind, 1 site, 1 height requirements are satisfied by the current selection context. For example, it checks that the currently selected wind group member is a wind (not a wind group). The same syntactical pattern is used for each test and warning.

It complains by MsgBox if the requirement is not met. We expect that the GUI's selection context code will make sure that the script would not be enabled, but just in case... this code is here to catch the problem.

Note that the VbCrLf constant used here will probably not work.

I think that the CastSiteGroupMemberToSite invocation is unnecessary here, because the CurrentSite object is already an ISite if it's not nothing.
'Set up the word bits and bobs
Set WordApplication = CreateObject("Word.Application")
WordApplication.Visible = True
Set Document = WordApplication.Documents.Add
Set Paragraph = Document.Paragraphs.Add
Set Selection = WordApplication.Selection

'STYLE
Document.Styles(-1).Font.Name = "Tahoma"
Document.Styles(-3).Font.Name = "Tahoma"
Document.Styles(-2).Font.Name = "Tahoma"
 Create the MS Word object to which we will be writing the report, and set up some formating rules which we can apply later on.
Selection.WholeStory
Selection.Style = Document.Styles(-2)
Selection.TypeText "WAsP Engineering detailed report for site" '& vbCrLf
Selection.TypeText vbCrLf & CurrentSite.Description & " at " & WorkingHeight.HeightAgl & "m a.g.l."
Selection.TypeParagraph
 Set up a heading for the report and use the TypeParagraph command to send a line feed.
Selection.Style = Document.Styles(-3)
Selection.TypeText "Project parameters"
Selection.TypeParagraph

'Selection.Style = Document.Styles(-1)
Selection.TypeText "Project name: " & CurrentProject.Name
Selection.TypeParagraph

Set VectorMap = CurrentProject.Domain.VectorMap
Set SourceFileTrace = CurrentProject.SourceFileTraces.SourceFileTraceForObject(VectorMap)
If Not SourceFileTrace Is Nothing Then
Selection.TypeText ("Vector map source name: " & SourceFileTrace.OriginalName)
End If
Selection.TypeParagraph
 Write some essential information about the project: its name, and the original import file name of the vector map which was used when setting up the project domain. This is retrieved from the source file traces.
Selection.TypeText ("Latitude of area: " & CurrentProject.Domain.Latitude & "°")
Selection.TypeParagraph
 Write the domain latitude (in degrees).
Selection.TypeText ("Calculation domain:")
Set DomainExtent = CurrentProject.Domain.GridSpecification.AsIRveaRectangle
Selection.TypeText (vbCrLf & vbTab & "East-West extension: " & FormatNumber(DomainExtent.MinimumX, 0, -1, 0, 0) & " m to " & FormatNumber(DomainExtent.MaximumX, 0, -1, 0, 0) & " m")
Selection.TypeText (vbCrLf & vbTab & "South-North extension: " & FormatNumber(DomainExtent.MinimumY, 0, -1, 0, 0) & " m to " & FormatNumber(DomainExtent.MaximumY, 0, -1, 0, 0) & " m")
Selection.TypeText (vbCrLf & vbTab & "Resolution: " & FormatNumber(CurrentProject.Domain.GridSpecification.Resolution, 0, -1, 0, 0) & " m")
Selection.TypeText (vbCrLf & vbTab & "Number of points in East-West direction: " & CurrentProject.Domain.GridSpecification.Columns)
Selection.TypeText (vbCrLf & vbTab & "Number of points in South-North direction: " & CurrentProject.Domain.GridSpecification.Rows)

If CurrentProject.Domain.RoughnessGridMap.FlagValue = 1 Then
Selection.TypeText (vbCrLf & "Selected uniform roughness: " & FormatNumber(CurrentProject.Domain.RoughnessGridMap.CellValue(1, 1), 5, -1, 0, 0))
End If
 Describe the domain's grid structure.
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText "Driving Wind: (" & Wind.Description & ")"
 Start a paragraph to describe the wind. This 'Wind' variable was initialised in the code above, using the CurrentWindGroupMember context selection.
Set ReducedGeostrophicWind = TypeCaster.CastWindToIReducedGeostrophicWind(Wind)
If Not ReducedGeostrophicWind Is Nothing Then
Selection.TypeText (vbCrLf & vbTab & "Wind type: Reduced Geostrophic.")
Selection.TypeText (vbCrLf & vbTab & "Direction and speed: " & FormatNumber(Wind.Direction, 1, 0, 0, 0) & "°, " & FormatNumber(Wind.Speed, 2, -1, 0, 0) & " m/s.")
Selection.TypeText (vbCrLf & vbTab & "Roughness and height: " & FormatNumber(ReducedGeostrophicWind.MeasurementRoughnessLength, 5, -1, 0, 0) & " m, ")
Selection.TypeText (FormatNumber(ReducedGeostrophicWind.MeasurementHeightAGL, 1, -1, 0, 0) & " m.")
Else
Set GeostrophicWind = TypeCaster.CastWindToIGeostrophicWind(Wind)
If Not GeostrophicWind Is Nothing Then
Selection.TypeText (vbCrLf & vbTab & "Wind type: Geostrophic.")
Selection.TypeText (vbCrLf & vbTab & "Direction and speed: " & FormatNumber(Wind.Direction, 2, 0, 0, 0) & "°, " & FormatNumber(Wind.Speed, 2, -1, 0, 0) & " m/s.")

Else
Set MeasuredWind = TypeCaster.CastWindToIMeasuredWind(Wind)
If Not MeasuredWind Is Nothing Then
Selection.TypeText (vbCrLf & vbTab & "Wind type: Measured wind.")
Selection.TypeText (vbCrLf & vbTab & "Direction and speed: " & FormatNumber(Wind.Direction, 2, 0, 0, 0) & "°, " & FormatNumber(Wind.Speed, 2, -1, 0, 0) & " m/s.")
Selection.TypeText (vbCrLf & vbTab & "Measurement height: " & FormatNumber(MeasuredWind.MeasurementHeightAGL, 1, -1, 0, 0) & " m, ")
Selection.TypeText ("Location: (" & FormatNumber(MeasuredWind.LocationX, 0, -1, 0, 0) & " m, " & FormatNumber(MeasuredWind.LocationY, 0, -1, 0, 0) & " m).")
End If
End If
End If
 This code works out which kind of wind it is, using the TypeCaster object, and reports the relevant properties.
Selection.TypeParagraph

Selection.Style = Document.Styles(-3)
Selection.TypeText "Site flow description"
Selection.TypeParagraph
Selection.Style = Document.Styles(-1)

Selection.TypeText ("Position and terrain elevation: (" & FormatNumber(Site.LocationX, 0, -1, 0, 0) & ", " & FormatNumber(Site.LocationY, 0, -1, 0, 0) & ", " & FormatNumber(Site.Elevation, 1, -1, 0, 0) & ") m")
 Start a paragraph about the site, which was assigned earlier from the CurrentSite selection context object. Write the site's location and elevation.
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdForDynamicRoughness)
Selection.TypeText (vbCrLf & "Dynamic Roughness: " & FormatNumber(Wind.PointResult(DataSelection, Site, WorkingHeight), 5, -1, 0, 0) & " m")
Selection.TypeText (vbCrLf & "Height: " & FormatNumber(WorkingHeight.HeightAgl, 1, -1, 0, 0) & " m")
 Get the DataSelection object for dynamic roughness results, and use that to retrieve the result from the wind, for this site.
Selection.TypeParagraph
Selection.Style = Document.Styles(-4)
' Selection.Font.Name = "Tahoma"
Selection.TypeText "Mean flow parameters"
Selection.TypeParagraph
Selection.Style = Document.Styles(-1)

Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdForDirection)
Selection.TypeText ("Wind direction, horizontal speed and velocity tilt: " & FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 1, -1, 0, 0) & "°")

Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(12) 'edvHorizontalSpeed
HorizontalSpeed = Wind.PointResult(DataSelection, CurrentSite, Currentheight)
Selection.TypeText (", " & FormatNumber(HorizontalSpeed, 2, -1, 0, 0) & " m/s, ")

Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdForVelocityTilt)
Selection.TypeText (FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 1, -1, 0, 0) & "°")

Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdForShelteredSpeed)
Speed = Wind.PointResult(DataSelection, CurrentSite, Currentheight)
If Abs(Speed) < 100 Then
Selection.TypeText (vbCrLf & "Sheltered speed: " & FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 2, -1, 0, 0) & " m/s")
End If

Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdForAlpha)
Selection.TypeText (vbCrLf & "Alpha: " & FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 3, -1, 0, 0))
 Get various other DataSelection objects and use them to recover different results about the mean flow.

The sheltered speed is only written if the value is less than 100. I don't understand that.
Selection.TypeParagraph
Selection.TypeParagraph
'FLOW TABLE
Set objTable = Document.Tables.Add(Selection.Range, 4, 4)
'wdTableFormatClassic1
Selection.Tables(1).AutoFormat 4, True, True, True, True, True, False, True, False, False

objTable.Rows(1).Range.Font.Italic = True
objTable.Cell(1, 1).Range.Text = "Mean flow derivatives"
objTable.Cell(1, 2).Range.Text = "d/dx [/m]"
objTable.Cell(1, 3).Range.Text = "d/dy [/m]"
objTable.Cell(1, 4).Range.Text = "d/dz [/m]"

objTable.Cell(2, 1).Range.Text = "U [m/s]"
objTable.Cell(2, 2).Range.Text = "Calculating..."
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordUdx)
objTable.Cell(2, 2).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordUdy)
objTable.Cell(2, 3).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordUdz)
objTable.Cell(2, 4).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)

objTable.Cell(3, 1).Range.Text = "V [m/s]"
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordVdx)
objTable.Cell(3, 2).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordVdy)
objTable.Cell(3, 3).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordVdz)
objTable.Cell(3, 4).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)

objTable.Cell(4, 1).Range.Text = "Tilt [°]"
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordTiltdx)
objTable.Cell(4, 2).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordTiltdy)
objTable.Cell(4, 3).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)
Set DataSelection = TheProjectClass.DataSelectionLists.AllSelections.ItemByID(TypeCaster.IdFordTiltdz)
objTable.Cell(4, 4).Range.Text = FormatNumber(Wind.PointResult(DataSelection, CurrentSite, Currentheight), 5, -1, 0, 0)

Selection.Tables(1).AutoFormat 4, True, True, True, True, True, False, True, False, True
Selection.EndKey 6 'Unit:=wdStory
 A table is created, and filled with the various wind flow derivative values. The local DataSelection variable is re-assigned continuously to retrieve different restults from the wind.
'TURBULENCE TABLE
' Selection.TypeParagraph

Selection.Style = Document.Styles(-4)
Selection.Font.Name = "Tahoma"
Selection.TypeText "Turbulence, Kaimal et al(1972)"
Selection.TypeParagraph
' Selection.Style = Document.Styles(-1)

'FLOW TABLE
Set objTable = Document.Tables.Add(Selection.Range, 3, 4)
'wdTableFormatClassic1
Selection.Tables(1).AutoFormat 4, True, True, True, True, True, False, True, False, False
Bum = objTable.Columns(1).Width
objTable.Columns(1).Width = Bum + 24
objTable.Columns(2).Width = Bum - 8
objTable.Columns(3).Width = Bum - 8
objTable.Columns(4).Width = Bum - 8
objTable.Rows(1).Range.Font.Italic = True
objTable.Cell(1, 1).Range.Text = ""
objTable.Cell(1, 2).Range.Text = "u"
objTable.Cell(1, 3).Range.Text = "v"
objTable.Cell(1, 4).Range.Text = "w"

objTable.Cell(2, 1).Range.Text = "Standard deviation [m/s]"
 Set up an MSWord table to hold the turbulence results.
objTable.Cell(2, 2).Range.Text = "Calculating..."
 Give the user some feedback while the turbulence results is calculated. The cell value will be overwritted with the actual result when it's been calculated. (This is a nice trick that works well in Excel too.)
Set Turby = Wind.Turbulence(CurrentSite, Currentheight, tstKWIC)
 Get the turbulence object result from the wind, for this site and height.

Note that the Kaimal spectrum type is requested, but almost accidentally. Because the constants don't work properly in the scripting context, this tstKWIC evaluates to zero. Fortunately, that's the same value as the corresponding enum constant, though, so in this case it works. If you tried to change it, it wouldn't.

Instead, the TypeCaster object could be used to furnish the correct value, or the literal value could be typed in to the script code.
ddx = Turby.Sigma(TypeCaster.IdForVelocityComponentU, TypeCaster.IdForVelocityComponentU)
objTable.Cell(2, 2).Range.Text = FormatNumber(Sqr(ddx), 1, -1, 0, 0)
objTable.Cell(2, 3).Range.Text = "Calculating..."
ddy = Turby.Sigma(TypeCaster.IdForVelocityComponentV, TypeCaster.IdForVelocityComponentV)
objTable.Cell(2, 3).Range.Text = FormatNumber(Sqr(ddy), 1, -1, 0, 0)
objTable.Cell(2, 4).Range.Text = "Calculating..."
ddz = Turby.Sigma(TypeCaster.IdForVelocityComponentW, TypeCaster.IdForVelocityComponentW)
objTable.Cell(2, 4).Range.Text = FormatNumber(Sqr(ddz), 1, -1, 0, 0)
 The turbulence sigma values are calculated and written out to the report.
objTable.Cell(3, 1).Range.Text = "Turbulence intensity [%]"

objTable.Cell(3, 2).Range.Text = FormatNumber(Sqr(ddx) * 100 / HorizontalSpeed, 1, -1, 0, 0)
objTable.Cell(3, 3).Range.Text = FormatNumber(Sqr(ddy) * 100 / HorizontalSpeed, 1, -1, 0, 0)
objTable.Cell(3, 4).Range.Text = FormatNumber(Sqr(ddz) * 100 / HorizontalSpeed, 1, -1, 0, 0)

 The turbulence intensity is calculated from the sigma values, using the windspeed retrieved earlier.
Selection.Tables(1).AutoFormat 4, True, True, True, True, True, False, True, False, True
Selection.EndKey 6 'Unit:=wdStory

 The turbulence table is closed.
End Sub

 The Sub Main() is ended.
]]></ScriptCode>
 The ScriptCode element is closed.
</RveaWengInternalScript>
 The whole script XML document is closed.


Turbulence rose

There's a special turbulence rose script, which is marked as a Utility script requiring one site and one height to be selected.

<ScriptType>Utility</ScriptType>
<RequiredProjectSelection>epmtSite</RequiredProjectSelection>
<RequiredProjectSelection>epmtHeight</RequiredProjectSelection>

The essential script code itself is really short, because it invokes objects in a separate helper DLL (called Rvea0085):

Set RoseMaker = CreateObject("Rvea0085.TurbulenceRoseMaker")
Call RoseMaker.PrepareATurbulenceRose(CurrentProject, Site, WorkingHeight)

In this case, we're using the scripts as a way of extending the user interface to explore new functionality before integrating it to the main program. There should be a turbulence rose object built right into the main GUI within the next version or two.


Working with WAsP

With WAsP Engineering 2.0, we've released a new script which generates a site report that integrates results from both WAsP and WEng. The script file is called WengSiteAssessmentWithWeibull.wes2. In order to run that script, you must have licences for both programs installed on the computer.

The invocation program element

If you examine the script file, you'll notice that there's an unusual element in the header XML

<Invocation ProgramName="Wasp8"/>

This warns the WEng GUI that WAsP modelling facilities will be needed while the script is executing, and the WEng GUI takes care of ensuring that this will be possible.

Creating the WAsP workspace

When the script is executed, there's no WAsP session in context: we can't magically refer to a CurrentWaspWorkspace as we can to a CurrentProject, for example. So, a WAsP workspace needs to created in code and manipulated according to the needs of the script.

The manipulation of the workspace and workspace objects is covered in the WAsP scripting section of this help facility, but the creation of the workspace will of course not be required there because the WAsP GUI executable will provide the current workspace object as part of the scripting context when running a script from within WAsP.

The following code creates a new WAsP workspace in memory, and adds an empty project to it.

Set Rvea0044Classes = CreateObject("Rvea0044.Rvea0044Classes")
Set WaspWorkspaceClass = Rvea0044Classes.WaspWorkspaceClass
Set WaspWorkspace = WaspWorkspaceClass.CreateNewInstance
Set WaspProject =
 WaspWorkspace.AsIHierarchyMember.Insertions.New.ByClassID(ehmcProject).Execute

The Insertions... Execute pattern for adding new workspace members is described in the WAsP object model documentation.

Putting the map from WEng to WAsP

Because WAsP and WEng share the same fundamental data objects, you can simply set up a vector map for the new WAsP project by copying it from the WEng project domain.

MapFilename = TypeCaster.GetTemporaryFilename
Set MapObject = CurrentProject.Domain.VectorMap
Set Jam = TypeCaster.CastObjectToRveaRveaPreservableObject(MapObject)
Jam.PreserveToFile (MapFilename)
Call WaspProject.Insertions.FromFile.ByClassID(ehmcVectorMap).Execute(MapFilename, Nothing)

The MapFileName variable is just a string. The MapObject implements the IRveaPreservableObject interface, so can be saved to file after type casting. The Jam variable is implicitly set to be an IRveaPreservableObject. Then the same file can be opened as a vector map in the WAsP project.

Saving what you've done

It's possible to save the WAsP workspace that's been created in this way. The WaspWorkspace object implements the IRveaPreservableObject interface, and actually has an explicit typecast method built in.

WaspWorkspace.AsIRveaPreservableObject.PreserveToFile("c:\foobar.wwh")


Projectspace interfaces

This document enumerates the interfaces

Index

  • IDataSelection
  • IDataSelectionList
  • IDataSelectionLists
  • IExportableProjectMember
  • IExtremeWind
  • IExtremeWindRose
  • IGenericExtremeWindClimate
  • IGeostrophicWind
  • IHeight
  • IHeightGroup
  • IHeightGroupIterator
  • IHeightGroupMember
  • IMeasuredWind
  • IObservedExtremeWindClimate
  • IPortableSiteGroupProvider
  • IPortableSiteGroupReceiver
  • IProjectChangeObserver
  • IProjectDomain
  • IProjectPersistenceSettings
  • IReducedGeostrophicWind
  • IRegionalExtremeWindClimate
  • IRvea0081Client
  • ISector
  • ISite
  • ISiteGroup
  • ISiteGroupIterator
  • ISiteGroupMember
  • ISourceFileTrace
  • ISourceFileTraces
  • ITransectSiteGroup
  • ITurbulence
  • ITurbulenceCrossSpectrum
  • ITurbulenceSpectrum
  • IUnstructuredSiteGroup
  • IUnstructuredWindGroup
  • IWengProject
  • IWengProjectClass
  • IWind
  • IWindGroup
  • IWindGroupIterator
  • IWindGroupMember

IDataSelection

Properties:

  • Property Description As String [r/o]
  • Property FlagValue As Single [r/o]
  • Property FormatString As String [r/o]
  • Property IsAvailableAsGrid As Boolean [r/o]
  • Property IsAvailableForSite As Boolean [r/o]
  • Property RequiresHeightContext As Boolean [r/o]
  • Property RequiresWindContext As Boolean [r/o]
  • Property ShortDescription As String [r/o]
  • Property Units As String [r/o]

IDataSelectionList

Properties:

  • Property Count As Long [r/o]
  • Property Description As String [r/o]
  • Property ItemByDescription(ByVal Description As String) As IDataSelection [r/o]
  • Property ItemByID(ByVal ID As eDataSelectionID) As IDataSelection [r/o]
  • Property ItemByIndex(ByVal Index As Long) As IDataSelection [r/o]

IDataSelectionLists

Properties:

  • Property AllSelections As IDataSelectionList [r/o]
  • Property GridSelections As IDataSelectionList [r/o]
  • Property SiteSelections As IDataSelectionList [r/o]

IExportableProjectMember

Properties:

  • Property IsReadyToExport As Boolean [r/o]
  • Property PreservableClass As IRveaPreservableClass [r/o]

Methods:

  • Sub Export(ByVal Filename As String, [ByVal FileFilter As IRveaFileFilter = 0], [ByVal DoReassignSourceFileTrace As Boolean = False])

IExtremeWind

Properties:

  • Property AsIRveaExtremeWind As IRveaExtremeWind [r/o]
  • Property AsIWind As IWind [r/o]
  • Property AsIWindGroupMember As IWindGroupMember [r/o]
  • Property Description As String [r/o]
  • Property GumbelDistribution As IRveaGumbelDistributionSimple [r/o]
  • Property Sector As IRveaRoseSector [r/o]
  • Property SpeedSequence As IRveaExtremeWindSpeedSequence [r/o]

IExtremeWindRose

Properties:

  • Property CountOfSectors As Long [r/o]
  • Property OmniDirectionalGumbelDistribution As IRveaGumbelDistributionSimple [r/o]
  • Property OmniDirectionalSpeedSequence As IRveaExtremeWindSpeedSequence [r/o]
  • Property SectorOneCentreAngleDegrees As Single [r/o]
  • Property WindForSectorIndex(ByVal Index As Long) As IExtremeWind [r/o]

IGenericExtremeWindClimate

Properties:

  • Property AsIWindGroup As IWindGroup [r/o]
  • Property AsIWindGroupMember As IWindGroupMember [r/o]
  • Property Description As String [r/o]
  • Property ExtremeWindRose As IExtremeWindRose [r/o]
  • Property SourceDataSouvenir As IRveaSourceDataSouvenir [r/o]

Methods:

  • Function ApplyToPoint(ByVal Site As ISite, ByVal Height As IHeight) As IRveaExtremeWindRose

IGeostrophicWind

Properties:

  • Property AsIWind As IWind [r/o]

Methods:

  • Sub Edit(ByVal Direction As String, ByVal Speed As String, [ByVal Description As String])

IHeight

Properties:

  • Property AsIHeightGroupMember As IHeightGroupMember [r/o]
  • Property Description As String [r/o]
  • Property HeightAGL As Single [r/o]
  • Property IsEditable As Boolean [r/o]
  • Property ShortDescription As String [r/o]

Methods:

  • Sub Edit(ByVal NewHeight As Single, ByVal NewDescription As String)

IHeightGroup

Properties:

  • Property AsIHeightGroupMember As IHeightGroupMember [r/o]
  • Property Description(ByVal String) [w/o]

Methods:

  • Function CreateIterator([ByVal CollapseGroupsToList As Boolean = False]) As IHeightGroupIterator
  • Function FindMemberByDescription(ByVal Description As String, [ByVal DoRecursiveSeek As Boolean = True]) As IHeightGroupMember
  • Function FindMemberByHeight(ByVal HeightAGL As Single, [ByVal DoRecursiveSeek As Boolean = True]) As IHeight
  • Sub RemoveMember(ByVal Member As IHeightGroupMember)

IHeightGroupIterator

Properties:

  • Property Count As Long [r/o]
  • Property CurrentMember As IHeightGroupMember [r/o]
  • Property FirstMember As IHeightGroupMember [r/o]
  • Property IsLastMember As Boolean [r/o]
  • Property NextMember As IHeightGroupMember [r/o]

IHeightGroupMember

Properties:

  • Property Description As String [r/o]
  • Property ParentGroup As IHeightGroup [r/o]

IMeasuredWind

Properties:

  • Property AsIWind As IWind [r/o]
  • Property LocationX As Single [r/o]
  • Property LocationY As Single [r/o]
  • Property MeasurementHeightAGL As Single [r/o]

Methods:

  • Sub Edit(ByVal Direction As String, ByVal Speed As String, ByVal LocationX As Single, ByVal LocationY As Single, ByVal MeasurementHeightAGL As Single, [ByVal Description As String])

IObservedExtremeWindClimate

Properties:

  • Property AnemometerSiteDetails As IRveaAnemometerSiteDetails [r/o]
  • Property AsIWindGroup As IWindGroup [r/o]
  • Property AsIWindGroupMember As IWindGroupMember [r/o]
  • Property Description As String [r/o]
  • Property ExtremeWindRose As IExtremeWindRose [r/o]
  • Property Location As IRveaPoint [r/o]
  • Property SourceDataSouvenir As IRveaSourceDataSouvenir [r/o]

Methods:

  • Function ApplyToPoint(ByVal Site As ISite, ByVal Height As IHeight) As IRveaExtremeWindRose
  • Sub SetLocation(ByVal LocationX As Single, ByVal LocationY As Single)

IPortableSiteGroupProvider

Properties:

  • Property SuggestedFileTitle As String [r/o]

Methods:

  • Function ExtractPortableSiteGroup(ByVal DoRecursively As Boolean, ByVal DoMakeFlatList As Boolean) As IRveaPortableSiteGroup

IPortableSiteGroupReceiver

Methods:

  • Function CanThisGroupBeReceived(ByVal CandidateGroup As IRveaPortableSiteGroup) As Boolean

IProjectChangeObserver

Methods:

  • Sub NotifyChange(ByVal ChangingObject As Object)

IProjectDomain

Properties:

  • Property GridSpecification As IRveaGridMapSpecification [r/o]
  • Property Latitude As Single [r/o]
  • Property OrographicGridMap As IRveaRealGridMap [r/o]
  • Property RoughnessGridMap As IRveaRealGridMap [r/o]
  • Property VectorMap As IRveaVectorMap [r/o]

IProjectPersistenceSettings

Properties:

  • Property CompressionLevel As eProjectFileCompressionLevel [r/w]
  • Property DoSourceFileTraceChecking As Boolean [r/w]
  • Property ResultsCachePreservationPolicy As eResultsCachePreservationPolicy [r/w]

IReducedGeostrophicWind

Properties:

  • Property AsIWind As IWind [r/o]
  • Property MeasurementHeightAGL As Single [r/o]
  • Property MeasurementRoughnessLength As Single [r/o]

Methods:

  • Sub Edit(ByVal Direction As String, ByVal Speed As String, ByVal MeasurementHeightAGL As Single, ByVal MeasurementRoughnessLength As Single, [ByVal Description As String])

IRegionalExtremeWindClimate

Properties:

  • Property AsIWindGroup As IWindGroup [r/o]
  • Property AsIWindGroupMember As IWindGroupMember [r/o]
  • Property Description As String [r/o]
  • Property ExtremeWindRose As IExtremeWindRose [r/o]
  • Property LatitudeDegrees As Single [r/o]
  • Property MeasurementHeightAGL As Single [r/o]
  • Property MeasurementRoughnessLength As Single [r/o]
  • Property SourceDataSouvenir As IRveaSourceDataSouvenir [r/o]

Methods:

  • Function ApplyToPoint(ByVal Site As ISite, [ByVal Height As IHeight]) As IRveaExtremeWindRose

IRvea0081Client

Properties:

  • Property ProgressMonitor As IRveaProgressMonitor2 [r/o]

Methods:

  • Sub CallbackForUnlicencedCalculationRequest(ByVal RejectedTaskDescription As String)

ISector

Properties:

  • Property CentreAngle As Single [r/o]
  • Property EndAngle As Single [r/o]
  • Property SectorWidth As Single [r/o]
  • Property StartAngle As Single [r/o]

ISite

Properties:

  • Property AsISiteGroupMember As ISiteGroupMember [r/o]
  • Property Description As String [r/o]
  • Property Elevation As Single [r/o]
  • Property IsEditable As Boolean [r/o]
  • Property IsLocated As Boolean [r/o]
  • Property LocationX As Single [r/o]
  • Property LocationY As Single [r/o]

Methods:

  • Sub Edit(ByVal NewX As Single, ByVal NewY As Single, ByVal Description As String)
  • Sub Move(ByVal NewX As Single, ByVal NewY As Single)

ISiteGroup

Properties:

  • Property AsISiteGroupMember As ISiteGroupMember [r/o]
  • Property BoundingRectangle As IRveaRectangle [r/o]
  • Property Description(ByVal String) [w/o]

Methods:

  • Function CreateIterator([ByVal CollapseGroupsToList As Boolean = False]) As ISiteGroupIterator
  • Function CreateIteratorOfAllSubGroups() As ISiteGroupIterator
  • Function FindMemberByDescription(ByVal Description As String, [ByVal DoRecursiveSeek As Boolean = True]) As ISiteGroupMember

ISiteGroupIterator

Properties:

  • Property Count As Long [r/o]
  • Property CurrentMember As ISiteGroupMember [r/o]
  • Property FirstMember As ISiteGroupMember [r/o]
  • Property IsLastMember As Boolean [r/o]
  • Property NextMember As ISiteGroupMember [r/o]

ISiteGroupMember

Properties:

  • Property Description As String [r/o]
  • Property ObstacleGroup As IRveaObstacleGroup [r/w]
  • Property ParentGroup As ISiteGroup [r/o]

ISourceFileTrace

Properties:

  • Property AssociatedObject As Object [r/o]
  • Property ModifiedTime As Date [r/o]
  • Property ModifiedTimeForLastNotification As Date [r/w]
  • Property NotificationOption As eSourceFileTraceNotificationOptions [r/w]
  • Property OriginalName As String [r/o]

ISourceFileTraces

Properties:

  • Property Count As Long [r/o]
  • Property SourceFileTrace(ByVal Index As Long) As ISourceFileTrace [r/o]
  • Property SourceFileTraceForObject(ByVal QueryObject As Object) As ISourceFileTrace [r/o]

ITransectSiteGroup

Properties:

  • Property AsISiteGroup As ISiteGroup [r/o]
  • Property Description As String [r/w]
  • Property IntersiteDistance As Single [r/o]
  • Property Length As Single [r/o]
  • Property NumberOfSites As Long [r/w]
  • Property OneEndSite As ISite [r/o]
  • Property OtherEndSite As ISite [r/o]
  • Property Site(ByVal Index As Long) As ISite [r/o]

Methods:

  • Function CreateIterator() As ISiteGroupIterator

ITurbulence

Properties:

  • Property CrossSpectrum(ByVal FirstComponent As eTurbulenceVelocityComponent, ByVal SecondComponent As eTurbulenceVelocityComponent, ByVal k1Min As Single, ByVal k1Max As Single, ByVal k1Step As Single, ByVal dy As Single, ByVal dz As Single) As ITurbulenceCrossSpectrum [r/o]
  • Property Sigma(ByVal FirstComponent As eTurbulenceVelocityComponent, ByVal SecondComponent As eTurbulenceVelocityComponent) As Single [r/o]
  • Property Spectrum(ByVal FirstComponent As eTurbulenceVelocityComponent, ByVal SecondComponent As eTurbulenceVelocityComponent, ByVal k1Min As Single, ByVal k1Max As Single, ByVal k1Step As Single) As ITurbulenceSpectrum [r/o]
  • Property SpectrumType As eTurbulenceSpectrumType [r/o]

ITurbulenceCrossSpectrum

Properties:

  • Property Imaginary(ByVal PointIndex As Long) As Single [r/o]
  • Property k1(ByVal PointIndex As Long) As Single [r/o]
  • Property NumberOfPoints As Long [r/o]
  • Property Real(ByVal PointIndex As Long) As Single [r/o]
  • Property SpectralDensity1(ByVal PointIndex As Long) As Single [r/o]
  • Property SpectralDensity2(ByVal PointIndex As Long) As Single [r/o]

ITurbulenceSpectrum

Properties:

  • Property k1(ByVal PointIndex As Long) As Single [r/o]
  • Property NumberOfPoints As Long [r/o]
  • Property SpectralDensity(ByVal PointIndex As Long) As Single [r/o]

IUnstructuredSiteGroup

Properties:

  • Property AsISiteGroup As ISiteGroup [r/o]
  • Property Description As String [r/w]

Methods:

  • Sub AddMember(ByVal Member As ISiteGroupMember)
  • Function CreateIterator([ByVal CollapseGroupsToList As Boolean = False]) As ISiteGroupIterator
  • Function FindMemberByDescription(ByVal Description As String, [ByVal DoRecursiveSeek As Boolean = True]) As ISiteGroupMember
  • Sub RemoveMember(ByVal Member As ISiteGroupMember)

IUnstructuredWindGroup

Properties:

  • Property AsIWindGroup As IWindGroup [r/o]
  • Property Description As String [r/w]

Methods:

  • Function CreateIterator([ByVal CollapseGroupsToList As Boolean = False]) As IWindGroupIterator
  • Function FindMemberByDescription(ByVal Description As String, [ByVal DoRecursiveSeek As Boolean = True]) As IWindGroupMember
  • Sub RemoveMember(ByVal Member As IWindGroupMember)

IWengProject

Properties:

  • Property AsIRveaConfigurable As IRveaConfigurable [r/o]
  • Property AsIRveaPreservableObject As IRveaPreservableObject [r/o]
  • Property Class As IWengProjectClass [r/o]
  • Property Configuration As IRveaConfiguration [r/o]
  • Property Domain As IProjectDomain [r/o]
  • Property Heights As IHeightGroup [r/o]
  • Property Name As String [r/o]
  • Property PersistenceSettings As IProjectPersistenceSettings [r/o]
  • Property Sites As IUnstructuredSiteGroup [r/o]
  • Property SourceFileTraces As ISourceFileTraces [r/o]
  • Property Winds As IUnstructuredWindGroup [r/o]

Methods:

  • Function AddGeostrophicWind(ByVal Direction As Single, ByVal Speed As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredWindGroup]) As IWind
  • Function AddHeight(ByVal HeightAGL As Single, [ByVal Description As String], [ByVal ParentGroup As IHeightGroup]) As IHeight
  • Function AddMeasuredWind(ByVal Direction As Single, ByVal Speed As Single, ByVal LocationX As Single, ByVal LocationY As Single, ByVal MeasurementHeightAGL As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredWindGroup]) As IWind
  • Function AddReducedGeostrophicWind(ByVal Direction As Single, ByVal Speed As Single, ByVal MeasurementHeightAGL As Single, ByVal MeasurementRoughnessLength As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredWindGroup]) As IWind
  • Function AddSite(ByVal LocationX As Single, ByVal LocationY As Single, [ByVal Description As String], [ByVal ParentGroup As IUnstructuredSiteGroup]) As ISite
  • Function AddTransectSiteGroup(ByVal Description As String, ByVal FirstPointLocationX As Single, ByVal FirstPointLocationY As Single, ByVal SecondPointLocationX As Single, ByVal SecondPointLocationY As Single, ByVal NumberOfSites As Long, [ByVal ParentGroup As IUnstructuredSiteGroup]) As ITransectSiteGroup
  • Function AddUnstructuredSiteGroup(ByVal Description As String, [ByVal ParentGroup As IUnstructuredSiteGroup]) As IUnstructuredSiteGroup
  • Function AddUnstructuredWindGroup(ByVal Description As String, [ByVal ParentGroup As IUnstructuredWindGroup]) As IUnstructuredWindGroup
  • Function ConvertOewcToRewc(ByVal Oewc As IObservedExtremeWindClimate) As IRegionalExtremeWindClimate
  • Function ImportObservedExtremeWindClimate(ByVal Filename As String, ByVal LocationX As Single, ByVal LocationY As Single, ByVal Filter As IRveaFileFilter, ByVal ParentGroup As IUnstructuredWindGroup) As IObservedExtremeWindClimate
  • Function ImportObstacleGroup(ByVal Filename As String, ByVal OriginX As Single, ByVal OriginY As Single, [ByVal Filter As IRveaFileFilter], [ByVal ParentSiteGroupMember As ISiteGroupMember]) As IRveaObstacleGroup
  • Function ImportRegionalExtremeWindClimate(ByVal Filename As String, [ByVal Filter As IRveaFileFilter], [ByVal ParentGroup As IUnstructuredWindGroup]) As IRegionalExtremeWindClimate
  • Function InsertPortableSiteGroup(ByVal Group As IRveaPortableSiteGroup, ByVal TargetParent As IPortableSiteGroupReceiver, ByVal DoAddNewHeights As Boolean, ByVal DoAddObstacles As Boolean) As IUnstructuredSiteGroup
  • Sub RedefineDomain(ByVal DomainVectorMapFilename As String, ByVal DomainGridSpecification As IRveaGridMapSpecification, ByVal DomainLatitude As Single, ByVal UseUniformRoughnessLength As Boolean, ByVal UniformRoughnessLength As Single)
  • Sub SubscribeObserverToProjectChanges(ByVal Observer As IProjectChangeObserver)
  • Sub UnSubscribeObserverToProjectChanges(ByVal Observer As IProjectChangeObserver)

IWengProjectClass

Properties:

  • Property AsIRveaPreservableClass As IRveaPreservableClass [r/o]
  • Property DataSelectionLists As IDataSelectionLists [r/o]

Methods:

  • Function CreateNewProject(ByVal DomainVectorMapFilename As String, ByVal DomainGridSpecification As IRveaGridMapSpecification, ByVal DomainLatitude As Single, ByVal UseUniformRoughnessLength As Boolean, ByVal UniformRoughnessLength As Single) As IWengProject
  • Function RestoreProjectFromFile(ByVal Filename As String, [ByVal Filter As IRveaFileFilter]) As IWengProject

IWind

Properties:

  • Property AsIWindGroupMember As IWindGroupMember [r/o]
  • Property Description As String [r/w]
  • Property Direction As Single [r/o]
  • Property GridResult(ByVal GridSelection As IDataSelection, [ByVal Height As IHeight]) As IRveaRealGridMap [r/o]
  • Property IsEditable As Boolean [r/o]
  • Property PointResult(ByVal DataSelection As IDataSelection, ByVal Site As ISite, [ByVal Height As IHeight]) As Single [r/o]
  • Property Speed As Single [r/o]
  • Property StandardReducedGeostrophicWindDirection As Single [r/o]
  • Property StandardReducedGeostrophicWindSpeed As Single [r/o]
  • Property Turbulence(ByVal Site As ISite, ByVal Height As IHeight, ByVal SpectrumType As eTurbulenceSpectrumType) As ITurbulence [r/o]
  • Property UpwindVelocityDerivatives(ByVal Site As ISite, ByVal Height As IHeight) As IRveaUpwindVelocityDerivatives [r/o]

IWindGroup

Properties:

  • Property AsIWindGroupMember As IWindGroupMember [r/o]

Methods:

  • Function CreateIterator([ByVal CollapseGroupsToList As Boolean = False]) As IWindGroupIterator
  • Function FindMemberByDescription(ByVal Description As String, [ByVal DoRecursiveSeek As Boolean = True]) As IWindGroupMember

IWindGroupIterator

Properties:

  • Property Count As Long [r/o]
  • Property CurrentMember As IWindGroupMember [r/o]
  • Property FirstMember As IWindGroupMember [r/o]
  • Property IsLastMember As Boolean [r/o]
  • Property NextMember As IWindGroupMember [r/o]

IWindGroupMember

Properties:

  • Property Description As String [r/o]
  • Property ParentGroup As IWindGroup [r/o]

Enum eDataSelectionID

  • edvElevation As Long=1
  • edvRoughness As Long=2
  • edvDynamicRoughness As Long=3
  • edvFetch As Long=4
  • edvFrictionVelocity As Long=5
  • edvTerrainInclination As Long=6
  • edvSpeed As Long=7
  • edvVelocityXComponent As Long=8
  • edvVelocityYComponent As Long=9
  • edvVelocityZComponent As Long=10
  • edvDirection As Long=11
  • edvHorizontalSpeed As Long=12
  • edvShelteredSpeed As Long=13
  • edvVelocityTilt As Long=14
  • edvdUdx As Long=15
  • edvdUdy As Long=16
  • edvdUdz As Long=17
  • edvdVdx As Long=18
  • edvdVdy As Long=19
  • edvdVdz As Long=20
  • edvdWdx As Long=25
  • edvdWdy As Long=26
  • edvdWdz As Long=27
  • edvdTiltdx As Long=21
  • edvdTiltdy As Long=22
  • edvdTiltdz As Long=23
  • edvAlpha As Long=24

Enum eProjectFileCompressionLevel

  • eclNone As Long=0
  • eclLow As Long=1
  • eclMedium As Long=6
  • eclHigh As Long=9

Enum eProjectMemberTypeID

  • epmtAny As Long=0
  • epmtHeight As Long=1
  • epmtWind As Long=2
  • epmtWindOrWindGroup As Long=15
  • epmtObservedExtremeWindClimate As Long=3
  • epmtRegionalExtremeWindClimate As Long=4
  • epmtGenericExtremeWindClimate As Long=5
  • epmtMeasuredWind As Long=6
  • epmtGeostrophicWind As Long=7
  • epmtReducedGeostrophicWInd As Long=8
  • epmtSite As Long=9
  • epmtUnstructuredSiteGroup As Long=10
  • epmtSiteOrSiteGroup As Long=14
  • epmtTransectSiteGroup As Long=11
  • epmtVectorMap As Long=12
  • epmtGridMap As Long=13

Enum eResultsCachePreservationPolicy

  • esdNoPreservation As Long=1
  • esdPreserveFourierSpacesToLocalDisk As Long=2

Enum eSourceFileTraceNotificationOptions

  • enoIfChanged As Long=0
  • enoNeverAgain As Long=1
  • enoOnlyIfChangedAgain As Long=2

Enum eTurbulenceVelocityComponent

  • etvcU As Long=1
  • etvcV As Long=2
  • etvcW As Long=3


Anatomy of a script file

Anatomy

The script file

Each script is saved in its own file. WAsP 10 script files have the extension *.was9. They are ASCII files, so you can just open them in Notepad or Internet Explorer to look at their contents.

The files themselves are written in XML, but contain a CDATA block which represents the actual script code. The XML is just used to provide meta-data: a context within which the script itself can be interpreted.

The CDATA block of actual script code should begin with a Sub Main() statement. The GUI executes each script by loading in the code and calling Main.

The XML

There is an XML schema for the script files, which defines precisely what the files can contain. The schema is documented here. It can be used to validate edited scripts, but of course it will not be able to check the contents of the code itself which is embedded in the CDATA block.

The <RveaWaspInternalScript> element

The script file's top level element is called <RveaWaspInternalScript>, it has four attributes.

Three are to do with the format version of the script. These attributes are needed so that if we change the format in future, the program can continue to work with older ones. If you are making a new script, then you should set the CurrentApplicationVersion to the version of WAsP which you can discover from the About box on the Help menu. Make sure that you use the correct format XX.XX.XXXX. If in doubt, set the MinimumApplicationVersion to the same value as the CurrentApplicationVersion.

The fourth attribute, 'Description', is the name of the script as it will appear in the script menu in the main program.

The <ScriptType> element

The script can only be of one type, which (at the time of writing) is constrained to be one of the following:

  • Report
  • Utility

WAsP uses this property to try to check that you've got the right output program installed. Some of the supplied sample scripts are MS Word , so WAsP will try to raise a helpful error if Word is not installed. The GUI will not actually prevent the you from trying to run the scripts, even if it thinks that the required programs are not available.

The <RequiredProjectSelection> element(s)

Script execution is initiated from the selected hierarchy member in the project view on the left hand side of the main window.

The script XML can contain one or more declarations about what selections are required. If more than one declaration is present, the the script will be available to each hierarchy member declared.

Here is a list of the possible selections.

  • MetStation
  • Note
  • ObservedWindClimate
  • ObstacleGroup
  • Project
  • ReferenceSite
  • ResourceGrid
  • RoughnessRose
  • SpatialImage
  • TurbineSite
  • TurbineSiteGroup
  • VectorMap
  • WindAtlas
  • WindTurbineGenerator
  • Workspace

The <ScriptCode> element

This contains the script code itself, in a CDATA block.

Another document describes the contents of this block.


The domain

Finding associated hierarchy members

I script generally runs on the selected hierarchy member. There are several ways to get references to other hierarchy members associated with the selected member.

Calculation Associates

The following members implement the ICalculationAssociate interface.

  • MetStation
  • ReferenceSite
  • ResourceGrid
  • TurbineSite
  • TurbineSiteGroup
  • WindAtlas

An explicit property for each of these members allows type casting to ICalculatingHierarchyMember which in turn provides access to the various types of calculation which are possible and their associated members:

Set Member = ReportingAssistant.SelectedHierarchyMember
Set MetStation = ReportingAssistant.TypeCaster.CastMemberToMetStation(Member)
Set Associates =
            MetStation.AsICalculatingHierarchyMember.CalculationByType(ectPredictedWindClimate).Associates

Set Map = Associates.VectorMap
Set Atlas = Associates.WindAtlas
Set RoughnessRose = Associates.RoughnessRose
Set Project = Associates.Project
Set OWC = Associates.ObservedWindClimate

Explicit properties

Some members such as vector maps (IVectorMap) have an explicit property which gives access to associated members. These generally are in the form of an iterator object (eg. IHierarchyMemberGroupIterator, ITurbineSiteGroupIterator). Here is an wind farm (IWindFarm) example:

Set Member = ReportingAssistant.SelectedHierarchyMember
Set WindFarm = ReportingAssistant.TypeCaster.CastMemberToWindFarm(Member)
Set AllSitesIterator = WindFarm.AllContributingSites
Set Site = ReportingAssistant.TypeCaster.CastMemberToTurbineSite(AllSitesIterator.FirstMember)

Do While Not Site Is Nothing
Msgbox Site.HubHeightAgl
Set Site = ReportingAssistant.TypeCaster.CastMemberToTurbineSite(AllSitesIterator.NextMember)
Loop


Curiosities

Rv44 internal type library needs to be in path

From Dragnet 996 (

Rvea0044Internal.tlb needs to be in path for Rv44 to permit automation

If you want to use an automation client (eg Delphi, or the TypeLibraryEditor) to work with Rvea0044.dll, then the Rvea0044Internal.tlb needs to be there in the same path.

We don't distribute that TLB with the main program, and it all runs OK. It's something about using queryinterface calls, I suppose.

This is actually good as a security feature, but it's just hard to remember that when you see the 'Cannot load DLL' error which appears.


RveaIternalScript

Schema RveaIternalScript.xsd

schema location: | D:\Help\RveaScripting\Content\Technical\SchemaDetails\WAsP10Scripts\RveaIternalScript.xsd
attribute form default: |
element form default: | qualified
Elements
ConversionSouvnier
RequiredProjectSelection
RveaWaspInternalScript
ScriptCode
ScriptType

element ConversionSouvnier
diagram
properties
content complex
used by
element RveaWaspInternalScript
attributes
Name | Type | Use | Default | Fixed | annotation
SourceFileTrace | xs:string | required |  |  |
Date | xs:string | required |  |  |
source <xs:element name="ConversionSouvnier">
<xs:complexType>
<xs:attribute name="SourceFileTrace" type="xs:string" use="required"/>
<xs:attribute name="Date" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>

attribute ConversionSouvnier/@SourceFileTrace
type | xs:string
properties
isRef | 0
use | required
source | <xs:attribute name="SourceFileTrace" type="xs:string" use="required"/>

attribute ConversionSouvnier/@Date
type | xs:string
properties
isRef | 0
use | required
source | <xs:attribute name="Date" type="xs:string" use="required"/>

element RequiredProjectSelection
diagram
type restriction of xs:string
properties
content simple
used by
element RveaWaspInternalScript
facets
Kind | Value | annotation
enumeration | MetStation |
enumeration | ObservedWindClimate |
enumeration | ObstacleGroup |
enumeration | Project |
enumeration | ResourceGrid |
enumeration | RoughnessRose |
enumeration | TurbineSite |
enumeration | TurbineSiteGroup |
enumeration | VectorMap |
enumeration | WindAtlas |
enumeration | WindTurbineGenerator |
enumeration | Workspace |
enumeration | ReferenceSite |
enumeration | Note |
source <xs:element name="RequiredProjectSelection">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="MetStation"/>
<xs:enumeration value="ObservedWindClimate"/>
<xs:enumeration value="ObstacleGroup"/>
<xs:enumeration value="Project"/>
<xs:enumeration value="ResourceGrid"/>
<xs:enumeration value="RoughnessRose"/>
<xs:enumeration value="TurbineSite"/>
<xs:enumeration value="TurbineSiteGroup"/>
<xs:enumeration value="VectorMap"/>
<xs:enumeration value="WindAtlas"/>
<xs:enumeration value="WindTurbineGenerator"/>
<xs:enumeration value="Workspace"/>
<xs:enumeration value="ReferenceSite"/>
<xs:enumeration value="Note"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

element RveaWaspInternalScript
diagram
properties
content complex
children ConversionSouvnier ScriptType RequiredProjectSelection ScriptCode
attributes
Name | Type | Use | Default | Fixed | annotation
MinimumApplicationVersion | xs:string | required |  |  |
CurrentApplicationVersion | xs:string | required |  |  |
FormatVersion | xs:string | required |  |  |
Description | xs:string | required |  |  |
source <xs:element name="RveaWaspInternalScript">
<xs:complexType>
<xs:sequence>
<xs:element ref="ConversionSouvnier" minOccurs="0"/>
<xs:element ref="ScriptType"/>
<xs:element ref="RequiredProjectSelection" minOccurs="0" maxOccurs="10"/>
<xs:element ref="ScriptCode"/>
</xs:sequence>
<xs:attribute name="MinimumApplicationVersion" type="xs:string" use="required"/>
<xs:attribute name="CurrentApplicationVersion" type="xs:string" use="required"/>
<xs:attribute name="FormatVersion" type="xs:string" use="required"/>
<xs:attribute name="Description" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>

attribute RveaWaspInternalScript/@MinimumApplicationVersion
type | xs:string
properties
isRef | 0
use | required
source | <xs:attribute name="MinimumApplicationVersion" type="xs:string" use="required"/>

attribute RveaWaspInternalScript/@CurrentApplicationVersion
type | xs:string
properties
isRef | 0
use | required
source | <xs:attribute name="CurrentApplicationVersion" type="xs:string" use="required"/>

attribute RveaWaspInternalScript/@FormatVersion
type | xs:string
properties
isRef | 0
use | required
source | <xs:attribute name="FormatVersion" type="xs:string" use="required"/>

attribute RveaWaspInternalScript/@Description
type | xs:string
properties
isRef | 0
use | required
source | <xs:attribute name="Description" type="xs:string" use="required"/>

element ScriptCode
diagram
type | xs:string
properties
content simple
used by
element RveaWaspInternalScript
source | <xs:element name="ScriptCode" type="xs:string"/>

element ScriptType
diagram
type extension of xs:string
properties
content | complex
mixed | true
used by
element RveaWaspInternalScript
attributes
Name | Type | Use | Default | Fixed | annotation
OutputType | derived by: xs:string | optional |  |  |
source <xs:element name="ScriptType">
<xs:complexType mixed="true">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="OutputType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="HTML"/>
<xs:enumeration value="Word"/>
<xs:enumeration value="Excel"/>
<xs:enumeration value="Latex"/>
<xs:enumeration value="PDF"/>
<xs:enumeration value="Text"/>
<xs:enumeration value="XML"/>
<xs:enumeration value="None"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>

attribute ScriptType/@OutputType
type restriction of xs:string
properties
isRef | 0
use | optional
facets
Kind | Value | annotation
enumeration | HTML |
enumeration | Word |
enumeration | Excel |
enumeration | Latex |
enumeration | PDF |
enumeration | Text |
enumeration | XML |
enumeration | None |
source <xs:attribute name="OutputType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="HTML"/>
<xs:enumeration value="Word"/>
<xs:enumeration value="Excel"/>
<xs:enumeration value="Latex"/>
<xs:enumeration value="PDF"/>
<xs:enumeration value="Text"/>
<xs:enumeration value="XML"/>
<xs:enumeration value="None"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>

XML Schema documentation generated by XMLSpy Schema Editor http://www.altova.com/xmlspy


weng2scriptsxsd

Schema Weng2Scripts.xsd

schema location: | D:\Help\RveaScripting\Content\Technical\SchemaDetails\Weng2Scripts\Weng2Scripts.xsd
attribute form default: |
element form default: | qualified
Elements
Comment
Invocation
LastRead
RequiredProjectSelection
RveaWengInternalScript
ScriptCode
ScriptType

element Comment
diagram
type xs:string
properties
content simple
used by
element RveaWengInternalScript
source
<xs:element name="Comment" type="xs:string"/>

element Invocation
diagram
properties
content complex
used by
element RveaWengInternalScript
attributes
Name | Type | Use | Default | Fixed | Annotation
ProgramName | xs:string | required |  |  |
source
<xs:element name="Invocation"> <xs:complexType> <xs:attribute name="ProgramName" type="xs:string" use="required"/> </xs:complexType> </xs:element>

element LastRead
diagram
type xs:dateTime
properties
content simple
used by
element RveaWengInternalScript
source
<xs:element name="LastRead" type="xs:dateTime"/>

element RequiredProjectSelection
diagram
type restriction of xs:string
properties
content simple
used by
element RveaWengInternalScript
facets
enumeration | epmtAny
enumeration | epmtHeight
enumeration | epmtHeightOrHeightGroup
enumeration | epmtWind
enumeration | epmtWindOrWindGroup
enumeration | epmtObservedExtremeWindClimate
enumeration | epmtRegionalExtremeWindClimate
enumeration | epmtGenericExtremeWindClimate
enumeration | epmtMeasuredWind
enumeration | epmtGeostrophicWind
enumeration | epmtReducedGeostrophicWInd
enumeration | epmtSite
enumeration | epmtSiteOrSiteGroup
enumeration | epmtUnstructuredSiteGroup
enumeration | epmtTransectSiteGroup
enumeration | epmtVectorMap
enumeration | epmtGridMap
source
<xs:element name="RequiredProjectSelection"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="epmtAny"/> <xs:enumeration value="epmtHeight"/> <xs:enumeration value="epmtHeightOrHeightGroup"/> <xs:enumeration value="epmtWind"/> <xs:enumeration value="epmtWindOrWindGroup"/> <xs:enumeration value="epmtObservedExtremeWindClimate"/> <xs:enumeration value="epmtRegionalExtremeWindClimate"/> <xs:enumeration value="epmtGenericExtremeWindClimate"/> <xs:enumeration value="epmtMeasuredWind"/> <xs:enumeration value="epmtGeostrophicWind"/> <xs:enumeration value="epmtReducedGeostrophicWInd"/> <xs:enumeration value="epmtSite"/> <xs:enumeration value="epmtSiteOrSiteGroup"/> <xs:enumeration value="epmtUnstructuredSiteGroup"/> <xs:enumeration value="epmtTransectSiteGroup"/> <xs:enumeration value="epmtVectorMap"/> <xs:enumeration value="epmtGridMap"/> </xs:restriction> </xs:simpleType> </xs:element>

element RveaWengInternalScript
diagram
properties
content complex
children ScriptType RequiredProjectSelection Invocation Comment ScriptCode LastRead
attributes
Name | Type | Use | Default | Fixed | Annotation
FormatVersion | xs:string | required |  |  |
MinimumApplicationVersion | xs:string | required |  |  |
CurrentApplicationVersion | xs:string | required |  |  |
ScriptInstanceVersion | xs:string | optional |  |  |
Description | xs:string | optional |  |  |
source
<xs:element name="RveaWengInternalScript"> <xs:complexType> <xs:sequence> <xs:element ref="ScriptType"/> <xs:element ref="RequiredProjectSelection" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="Invocation" minOccurs="0"/> <xs:element ref="Comment" minOccurs="0"/> <xs:element ref="ScriptCode" minOccurs="0"/> <xs:element ref="LastRead" minOccurs="0"/> </xs:sequence> <xs:attribute name="FormatVersion" type="xs:string" use="required"/> <xs:attribute name="MinimumApplicationVersion" type="xs:string" use="required"/> <xs:attribute name="CurrentApplicationVersion" type="xs:string" use="required"/> <xs:attribute name="ScriptInstanceVersion" type="xs:string" use="optional"/> <xs:attribute name="Description" type="xs:string" use="optional"/> </xs:complexType> </xs:element>

element ScriptCode
diagram
type xs:string
properties
content simple
used by
element RveaWengInternalScript
source
<xs:element name="ScriptCode" type="xs:string"/>

element ScriptType
diagram
type restriction of xs:string
properties
content simple
used by
element RveaWengInternalScript
facets
enumeration | WordReport
enumeration | HtmlReport
enumeration | ExcelReport
enumeration | TextFile
enumeration | Utility
source
<xs:element name="ScriptType"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="WordReport"/> <xs:enumeration value="HtmlReport"/> <xs:enumeration value="ExcelReport"/> <xs:enumeration value="TextFile"/> <xs:enumeration value="Utility"/> </xs:restriction> </xs:simpleType> </xs:element>

XML Schema documentation generated with XMLSpy Schema Editor http://www.altova.com/xmlspy


Hierarchy Members

In WAsP projects consist of a hierarchy of members, such as vector maps and turbine sites..


Saving hierarchy members

Use the IExportableHierarchyMember interface


The domain

MetStation

A met station can be retrieved from the project context as the selected hierarchy member, thus:

Set Domain = CurrentProject.Domain


Version differences

Version 1.x Weng scripts will not work in WEng 2.0.

However, there's no risk of confusion, because they have different file name extensions (*.wes for version 1; *.wes2 for version 2)

Updating a version 1.x script

If you've got a customised script from version 1.x which you want to update to use in WEng 2.0, then it's a fairly simple matter of pasting the existing code into a *.wes2 template file. The WEng projectspace object model is not much changed from version 1.x, so it's unlikely that there will be any problems. Email wengsupport@risoe.dk for help if you have any problems.