Jump to content

Change heights of met station, turbine sites, change map reference


Recommended Posts

I'd like to perform the following manipulations on workspace objects:

1. Change height of met station

2. Change hub height of turbine sites

3. Change map reference (If I include, say, 5 .map files in the .wwh archive, can I change which one the map object references to? The idea is that the roughness length values used change from map to map.)

Would it be possible for you to show me some example code to do the above? Thanks!
Link to comment
In WAsP, the met station height is taken from the TAB file, but I think you can actually change it in a script. Try ...

MetStation.AsIWaspSite.WorkingHeightAgl = 34

(Assuming you have got a correctly-typed reference to your MetStation object.)

For TurbineSites, just assign a new value like this

TurbineSite.HubHeightAgl =75

more later... D.
Link to comment
For this map reference thing, you could either have all the different maps in the workspace root and move them into the project in turn as needed, or you could keep them externally on disk and insert them from files in turn as needed. One makes for a big, self-contained workspace, and the other for a small workspace with map files outside. Which sounds better?
Link to comment
The self-contained workspace option sounds cleaner and safer. The larger file size isn't really a problem. It sounds like this is the way to go.

If you could show me some example code to move maps back and forth as you suggest, then that would be great.

Merry Christmas!

Jean-François
Link to comment
Hi Jean-François,

Here is some code which will allow you to move a map from workspace level into a project:

Set Project = ReportingAssistant.CastableSelectedMember.AsIWaspProject
Set Workspace = Project.AsIHierarchyMember.Parent


Set WorkspaceMapsIterator = Workspace.Children.FilterByClass(ReportingAssistant.AllClasses.VectorMapClass)
Set Map = WorkspaceMapsIterator.FirstMember
Do While Not Map Is Nothing
If Map.Description = "MyMap" Then
Set HierarchyMove = Map.BeginMove
Set HierarchyMove.CandidateNewParent = Project
If HierarchyMove.IsMovePossible Then
HierarchyMove.PerformMove
Else
Msgbox "This move not possible!"
End If
Exit Do
End If
Set Map = WorkspaceMapsIterator.NextMember
Loop

It is important to note that if the project already has a child member which is a map, then it will be replaced with the new map. If you don't want to lose this existing map then you should move it out to the workspace level before moving another one into the project.

Here is an example of how to move a map from the project back out to the workspace:

Set Map = Project.AsIHierarchyMember.Children.FirstMemberByClass(ReportingAssistant.AllClasses.VectorMapClass)
If Not Map Is Nothing Then
Set HierarchyMove = Map.BeginMove
Set HierarchyMove.CandidateNewParent = Workspace
If HierarchyMove.IsMovePossible Then
HierarchyMove.PerformMove
Else
Msgbox "This move not possible!"
End If
End If

Regards,
Ray
Link to comment
and here is some code to change the standard heights:

Set Project = ReportingAssistant.CastableSelectedMember.AsIWaspProject
Set Configuration = Project.AsIRveaConfigurable.Configuration

' Change the number of standard heights
Configuration.ParameterByID("NUMSTDH").Value=5

' Set default values for the standard heights
Configuration.ParameterByID("STDH1").Value=10
Configuration.ParameterByID("STDH2").Value=25
Configuration.ParameterByID("STDH3").Value=50
Configuration.ParameterByID("STDH4").Value=100
Configuration.ParameterByID("STDH5").Value=200
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...