GianlucaA Posted October 9, 2014 Posted October 9, 2014 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
Duncan Posted October 14, 2014 Posted October 14, 2014 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.
GianlucaA Posted October 15, 2014 Posted October 15, 2014 Hi Duncan & Ray,Thanks a lot for your feedback and supportG.
Ray Posted October 16, 2014 Posted October 16, 2014 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
GianlucaA Posted October 17, 2014 Posted October 17, 2014 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 supportG.
Ray Posted October 21, 2014 Posted October 21, 2014 Hi again,I have added two new type casting options to the TypeCaster:CastObjectToSessionEditableCastObjectToRveaWeibullWindEditablewhich 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 sessionToken = Session.StartEditingSessionFor 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 = FrequencyNext' End the wiebull rose editing sessionSession.EndEditingSession(Token)Sorry I couldn't give some something to use immediately but it is on the way.Cheers,Ray
GianlucaA Posted October 21, 2014 Posted October 21, 2014 Hi Ray!Thanks a lot, it sounds perfect and I would be glad in testing it.Please send me and email with details. After testing it, I 'm going to adapt the for the script instead of the "patch" I created to overcome it ;)RegardsGianluca
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now