Welcome to WEAP's Website WEAP
WEAP is an initiative of the Stockholm Environment Institute.


About WEAP

Home
Why WEAP?
Features
What's New?
Sample Screens
Demonstration
Publications
History and Credits

Using WEAP
Download
Licensing
User Guide
Tutorial
Videos (YouTube)

User Forum
Discussions
Members List
Edit Profile

Additional Support
Training
University Courses
Collaboration

About Us
SEI-US Water Resources Program
Please Contact Us

LEAP
Interested in Energy?
Read about LEAP: SEI's software for energy planning.

Link WEAP and LEAP for combined Water-Energy planning.
Watch a video demo!
   

User Forum

All Topics | Topic "Is it possible to automatically set the units with the ResultSetting function?"
Log in to post new messages or reply to existing messages.
 
Author Message
Eng. Miguel Ruiz

Subject: Is it possible to automatically set the units with the ResultSetting function?   
Posted: 4/18/2017 Viewed: 13185 times
Hi, I'm doing an automatization and I need to select the units of the Streamflow to m3/s, in order to export results into cvs.

Is it possible to select via COM, using the ResultSetting or other function the units?

Thanks a lot.

Mr. Jack Sieber

Subject: Re: Is it possible to automatically set the units with the ResultSetting function?   
Posted: 4/18/2017 Viewed: 13175 times
No, it is not possible to set the Results View unit via the API (COM).

Jack
Mr. Jack Johnson

Subject: Re: Is it possible to automatically set the units with the ResultSetting function?   
Posted: 5/18/2017 Viewed: 12783 times
Hi Jack,

Also a unit setting/automation related question.

I'm currently using the API through Python.

I have multiple Catchment nodes that I am trying to read data into. I have successfully read in data for several values but am struggling with the Area variable. It appears because there is no default unit for Area is given I cannot directly read in my data. If I manually set the units to Ha for example I can access the variable and set it as I wish.

So my question, is there a way I can set the units of the Area variable within a catchment node automatically? Either at a global or local scale. I'm happy to set it at a global scale manually if that is a possible solution.

Any advice would be appreciated!

Thanks,
Jack


Mr. Jack Sieber

Subject: Re: Is it possible to automatically set the units with the ResultSetting function?   
Posted: 5/18/2017 Viewed: 12775 times
At this time, it is not possible to set any units via the API. You will first need to set the unit manually in WEAP before you can use the API to set the expression for Area.

Jack
Mr. Felipe Ahumada

Subject: Re: Is it possible to automatically set the units with the ResultSetting function?   
Posted: 3/28/2022 Viewed: 4972 times
Hello Jack.

I was wondering if nowadays there has been an update to this topic.

Is there a way to set the unit for area for all the catchments?
Thanks in advance,

Felipe A.
Mr. Jack Sieber

Subject: Re: Is it possible to automatically set the units with the ResultSetting function?   
Posted: 3/28/2022 Viewed: 4968 times
Hello Felipe,

Yes, it is now possible to use the WEAP API to set units for Key Assumptions and Demand Sites and Catchments branches. For example, to set the area unit for all catchments to one thousand hectares, here is the VBS statement:

FOR EACH Br IN WEAP.Catchments
Br.Variables("Area").ScaleUnit = "1000 ha"
NEXT

Jack

Mr. Felipe Ahumada

Subject: Re: Is it possible to automatically set the units with the ResultSetting function?   
Posted: 3/30/2022 Viewed: 4957 times
Hi Jack
Thanks for your reply. It really helped!
Felipe A.
Topic "Is it possible to automatically set the units with the ResultSetting function?"