Subject: Scripting Posted: 6/24/2017 Viewed: 6651 times
dear friends Hi
I want to optimize some parameters.for do it, i must change "Monthly Demand" for Demand Area continuously.
if I determine one value for all parts , system will run successfully. for example:
WEAP.Branch("Demand Sites\Drink TRKminestan").Variables("Monthly Demand").Expression=26
but if I determine diffrent value for various parts , system shows Error window. for example:
WEAP.Branch("Demand Sites\Drink TRKminestan").Variables("Monthly Demand").Value(BaseYear ,5)=26
please help me how can solve this problems.
thank you for your aid
Mr. Jack Sieber
Subject: Re: Scripting Posted: 6/28/2017 Viewed: 6645 times
You can change expressions, but not individual values. WEAP uses one expression for all months of the Current Accounts, and one expression per scenario for all the months of each scenario. Therefore, if you want to change the value by month, you will either need to write an expression that varies by month, such as with the MonthlyValues function, or by reading in values from a CSV file using the ReadFromFile function.