how to make vensim update get xls constants?

Use this forum to post Vensim related questions.
Post Reply
kleemax
Senior Member
Posts: 125
Joined: Tue Jan 26, 2016 3:50 pm
Vensim version: PRO

how to make vensim update get xls constants?

Post by kleemax »

After changing values in an xls-file that I use as input and saving that xls file, vensim does not automatically read the new values. My work around is to close the model, reopen it and then vensim reads in the new values. My question is wether there is a key-combination (ideal), or at least a menue-command that I can click to make Vensim pick up the new values so I don't have to close the model every time. Please not that I am working on the mac version of Vensim so that it picks the values directly from the file not from the excel application.
tomfid
Administrator
Posts: 3808
Joined: Wed May 24, 2006 4:54 am

Re: how to make vensim update get xls constants?

Post by tomfid »

This is a Mac limitation. GET XLS uses GET DIRECT on the Mac, so the file has to be saved for changes to propagate. On Win GET XLS passes live values.
kleemax
Senior Member
Posts: 125
Joined: Tue Jan 26, 2016 3:50 pm
Vensim version: PRO

Re: how to make vensim update get xls constants?

Post by kleemax »

saving the xls file does not help.
saving the vensim file does not help either.
Only closing and reopening the vensim file helps.
But that is subotimal (I have to move the window to second screen, resize it, show hidden elements etc.) before I can start working again.
It seems Vensim does not re-read the xls file each time it runs a simulation. How can I make Vensim re-read the xls-file?
tomfid
Administrator
Posts: 3808
Joined: Wed May 24, 2006 4:54 am

Re: how to make vensim update get xls constants?

Post by tomfid »

That does sound wrong. I'll test.
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: how to make vensim update get xls constants?

Post by Administrator »

Can you post an example with step by step instructions so we can test?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
ekempbenedict
Junior Member
Posts: 11
Joined: Fri Aug 26, 2016 9:49 pm
Vensim version: DSS

Re: how to make vensim update get xls constants?

Post by ekempbenedict »

I am now running into a similar problem, using CSV files with GET DIRECT CONSTANTS. I ran the model with no problem when I had a single, unified CSV file. I would change the CSV file and Vensim would use the modified version. However, I have just split the data set into four different files, and Vensim no longer reads in data even after I save the files. I have to go to Settings -> XLS files -> Modify Selected (with no changes) -> Add Editing to force it to look again. (Or restart.)

Another change in my case is that I just updated to the new "Anniversary" edition of Windows 10. (Actually, not my choice -- MS did it for me, with no option to postpone.)

I attach my model, with data files.

Thanks,
Eric
Attachments
p2cs-multisector.zip
(10.41 KiB) Downloaded 205 times
tomfid
Administrator
Posts: 3808
Joined: Wed May 24, 2006 4:54 am

Re: how to make vensim update get xls constants?

Post by tomfid »

This just crashes when I attempt to run it. Will investigate.
ekempbenedict
Junior Member
Posts: 11
Joined: Fri Aug 26, 2016 9:49 pm
Vensim version: DSS

Re: how to make vensim update get xls constants?

Post by ekempbenedict »

Thanks very much. And interesting... it doesn't crash for me.
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: how to make vensim update get xls constants?

Post by Administrator »

ekempbenedict wrote:I am now running into a similar problem, using CSV files with GET DIRECT CONSTANTS. I ran the model with no problem when I had a single, unified CSV file. I would change the CSV file and Vensim would use the modified version. However, I have just split the data set into four different files, and Vensim no longer reads in data even after I save the files. I have to go to Settings -> XLS files -> Modify Selected (with no changes) -> Add Editing to force it to look again. (Or restart.)

Another change in my case is that I just updated to the new "Anniversary" edition of Windows 10. (Actually, not my choice -- MS did it for me, with no option to postpone.)

I attach my model, with data files.

Thanks,
Eric
Can you give me a list of parameters that are not updating? My tests here are working fine.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
ekempbenedict
Junior Member
Posts: 11
Joined: Fri Aug 26, 2016 9:49 pm
Vensim version: DSS

Re: how to make vensim update get xls constants?

Post by ekempbenedict »

Yes, I was changing "investment utilization sensitivity" in the CSV file and it was not updating in Vensim.
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: how to make vensim update get xls constants?

Post by Administrator »

ok, I think I've found the bug. Just need to do some testing before creating a new build.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
ekempbenedict
Junior Member
Posts: 11
Joined: Fri Aug 26, 2016 9:49 pm
Vensim version: DSS

Re: how to make vensim update get xls constants?

Post by ekempbenedict »

Thanks very much!
ekempbenedict
Junior Member
Posts: 11
Joined: Fri Aug 26, 2016 9:49 pm
Vensim version: DSS

Re: how to make vensim update get xls constants?

Post by ekempbenedict »

FYI, I discovered that part of the problem was the timestamp on the file. I have several versions of the CSV input files, and before a run I copy one version into the master using a Windows batch file. I realized that I have to "touch" the file to bring it up to date so Vensim knows that it's changed. This is my revised batch file:

use.bat

Code: Select all

DEL scalar_constants.csv
COPY scalar_constants_%1.csv scalar_constants.csv
TOUCH scalar_constants.csv
That works. If anyone is interested, it works like this:

Code: Select all

command line> use my_scenario
Then it copies 'scalar_constants_my_scenario.csv' into 'scalar_constants.csv' for the run.

Eric
Post Reply