Setting Time Bounds from Command Scripts

Use this forum to post Vensim related questions.
Post Reply
drw
Member
Posts: 43
Joined: Wed Mar 25, 2009 1:10 pm

Setting Time Bounds from Command Scripts

Post by drw »

From a command script is it possible to change the time bounds for a model such as INITIAL TIME? It would be great to avoid having to do this manually!

For example, we have a master energy model by country which we replicate for all countries whenever the model is updated and we have a command script to do that and update spreadsheet aliases (see example script below). However, is it possible to then change the INITIAL TIME to another year (say 1990) through the command script?

Example Script for one country

FILE>COPY|G:\US.mdl|CAN.mdl
SPECIAL>LOADMODEL|G:\CAN.mdl
SIMULATE>SPREADALIAS|?Input=CAN_Input.xlsb

Thanks for any help.
Dave
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

You can use SIMULATE>SETVAL>INTIAL TIME=1997

etc to set time bounds for a simulation. You could also put the time bounds in a spreadsheet, or create a .cin file with the time bounds and use that.
drw
Member
Posts: 43
Joined: Wed Mar 25, 2009 1:10 pm

Post by drw »

Thanks a lot Bob - works a treat!

I didn't appreciate you could treat 'Initial Time' as an equation though. But using it this way I can then pass the value for 'initial time' direct from the main control panel of our Excel files. A far more elegant solution.

Thanks again
Dave
Post Reply