All Topics | Topic: “WEAP API: Need array of all values in all years”
Author Message
Mr. Yatharth Sharma
Subject: WEAP API: Need array of all values in all years   
Posted: 8/24/2017 Viewed: 13328 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: 13306 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”