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 "WEAPApplication.Scenarios"
Log in to post new messages or reply to existing messages.
 
Author Message
Ms. Zahra Karimi

Subject: WEAPApplication.Scenarios   
Posted: 6/25/2022 Viewed: 5213 times
Dear All,
How can I remove these errors?

1.WEAPApplication.Scenarios: Invalid Scenario: Current Accounts.

2.WEAPApplication.ResultValue: Invalid Branch: Variable name:\...

I tried to use Examples (using VB script) in WEAP API Classes But I can not understand what is wrong! also, when I run the code several times, the errors change! some disappear new ones appear! I am a beginner and need help very much!If you have a sample file about this, please share with me.
Thank you all for your attention.

Mr. Doug Chalmers

Subject: Re: WEAPApplication.Scenarios   
Posted: 2/5/2025 Viewed: 105 times
Zahra and for anyone else wondering,

Best use practices of the API can be found in the WEAP Help- search for "Application API". You will need to ensure that your code is in the format listed for the scenario and resultvalue functions. The help lists the following examples:

PRINT WEAP.ResultValue("\Demand Sites\South City:Reliability") 'Reliability is for the entire study period, so doesn't have a year or time step parameter

SET S = WEAP.Scenario("Reference")
Topic "WEAPApplication.Scenarios"