All Topics | Topic: “copy value from key assumptions from variable to another via API”
Author Message
Mr. Miroslav Kandera
Subject: copy value from key assumptions from variable to another via API   
Posted: 11/19/2019 Viewed: 9916 times

Hello again,
i tried several times to write down script in API that would copy value of one variable from branch in key assumptions and paste it into other branch variable in key assumptions. CopyData works for Scale and Units, but not for values.

Any suggestions?

Thank you in advance...

Miroslav

Mr. Doug Chalmers
Subject: Re: copy value from key assumptions from variable to another via API   
Posted: 2/5/2025 Viewed: 2583 times

You can copy expressions using the API. See the Variable API in the WEAP help for more info.

For example, you could write:
WEAP.Branch("\Supply and Resources\Groundwater\Object A").Variables("Annual Activity Level").Expression = WEAP.Branch("\Supply and Resources\Groundwater\Object B").Variables("Annual Activity Level").Expression


Apologies for not responding to this question orginally.
Topic: “copy value from key assumptions from variable to another via API”