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 "WEAP API: Need array of all values in all years"
Log in to post new messages or reply to existing messages.
 
Author Message
Mr. Yatharth Sharma

Subject: WEAP API: Need array of all values in all years   
Posted: 8/24/2017 Viewed: 10304 times
Hi,

I am trying to use WEAP API to run a scenario. I am using
PRINT WEAP.ResultValue("\Demand Sites\West City:Unmet Demand[Cubic Feet]", 2015, 1, "Reference", 2015, WEAP.NumTimeSteps)

But it prints only the sum/avg etc of all the values.

What I need is a year by year value to be returned
something like: [10,11,12,13,14]

How can I get the same?
Thanks in advance
Mr. Jack Sieber

Subject: Re: WEAP API: Need array of all values in all years   
Posted: 9/13/2017 Viewed: 10282 times
There is no WEAP API function that will return multiple values. WEAP.ResultValue returns a single value, which can be for one timestep, or the sum/average/max/min for a range of timestep values.

Here is how to print the result values for 2015:

for ts = 1 to WEAP.NumTimeSteps
Print WEAP.ResultValue("\Demand Sites\West City:Unmet Demand[Cubic Feet]", 2015, ts, "Reference")
next
Topic "WEAP API: Need array of all values in all years"