Jump to content

Access WAsP Wind Atlas in write mode


Recommended Posts

Hi @All,

I need to change some parameters iteratively via script to wind atlas class, related to several GWC object, with wasp (version 11.1), .

I see that there is a typecasting that allows it (CastRveaWeibullDistributionToRveaWeibullDistributionEditable)


and I can successfully change wind atlas properties (A,k) with it.

Unfortunately I cannot access sector frequencies, that seems to be a property of other objects, (I'm guessing the class: IRveaWeibullWindEditable).

Does anyone know which object to access and the proper typecasting method, in order to allow it being accessible in write mode by user ?

Thanks in advance for any hint!!

Gianluca
Link to comment
Hi,

My colleague Ray is looking into this question and will reply to you. If nothing simple can be done, we will add some methods to the script execution context to let you achieve what you need.

We are very keen to help people who have invested such effort in discovering how to use the types and develop scripts.

Best wishes, Duncan.
Link to comment
Hi Gianluca,


It looks like you can't do this at the moment from a script. To get it to work we would need to add a couple of new type casting options to the TypeCaster. I will discuss this with Duncan and will let you know if this is something we can do.


So unfortunately I think at the moment the only way would be with a Developer licence, then this could done now with VBA.


Cheers,
Ray
Link to comment
Hi Ray,

Thanks a lot for the feedback.
I will try to overcome the issue with other approaches, as an explicit typecasting is not allowed.
But I would really appreciate if this can be directly done with your support in regular WAsP licence, since other parameters related to the distribution (A,k) can already be accessed in write mode. (via typecasting, of course)
Thanks a lot for the support

G.
Link to comment
Hi again,


I have added two new type casting options to the TypeCaster:



CastObjectToSessionEditable
CastObjectToRveaWeibullWindEditable


which make it possible to edit the sector frequencies from a script. We will be making a beta build of Wasp 11.2 in the coming days, this will be the first version to have this update. If you are interested to try this beta then let me know and I will send you download details when it is available.


Using these new type casts you will be able to edit sector frequencies with something like this:


Set Atlas = ReportingAssistant.TypeCaster.CastMemberToWindAtlas(ReportingAssistant.SelectedHierarchyMember)
Set Rose = Atlas.WeibullWindRose(1, 1)

' Before editing the WeibullWindRose an explicit type cast to IRveaSessionEdiatble is needed.
Set Session = ReportingAssistant.TypeCaster.CastObjectToSessionEditable(Rose)

' Start the Weibull rose editing session
Token = Session.StartEditingSession

For SectorIndex = 1 To 12
' Get a wind from the rose
Set SectorWind = Rose.WindForSectorIndex(SectorIndex)
' Explicit type cast of the wind to editable wind
Set WindEditable = ReportingAssistant.TypeCaster.CastObjectToRveaWeibullWindEditable(SectorWind)

' Set the frequency, the sum of frequencies across all sectors must be 1
Frequency = 1 / 12
WindEditable.SectorFrequency = Frequency
Next

' End the wiebull rose editing session
Session.EndEditingSession(Token)



Sorry I couldn't give some something to use immediately but it is on the way.


Cheers,
Ray
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...