Page 1 of 1

Changing vdf data sources from Excel using dll

Posted: Wed Dec 18, 2019 11:16 pm
by drw
Hi Folks,

Looking to understand what would be the recommended way to change a vdf input data source when interacting with a vensim package file using vensim_dll from Excel please. With Excel files, one can use the "SIMULATE>SPREADALIAS" command to change the input xls file (to use with say GET XLS DATA). However, is there an equivalent where you can change the input string for a vdf file from Excel?

By way of context, we have a single string variable which has the filename and path to use for any GET VDF DATA calls, but looking for a way to be able to manipulate that on the fly when running from Excel.

Many thanks,
Dave

Re: Changing vdf data sources from Excel using dll

Posted: Thu Dec 19, 2019 4:57 pm
by tomfid
I would recommend importing the spreadsheet to a vdf and using ordinary data variables rather than the GET VDF functions. Then you can control the data source via SIMULATE>DATA| and ADDDATA.

Re: Changing vdf data sources from Excel using dll

Posted: Fri Dec 20, 2019 12:44 am
by drw
Thanks a lot, those commands look like they could be a winner. For my understanding, when using results from another model run I need to export them as a *.DAT file first and then convert them to a vdf/vdfx to be read in as a data source (i.e. you cannot directly link to the results from another model run without the export and conversion process)?

Thanks,
Dave

Re: Changing vdf data sources from Excel using dll

Posted: Fri Dec 20, 2019 4:40 pm
by tomfid
Nope - a vdf output from one model can be read directly as input to another model. No conversion needed - you just need to have matching variable names.

Re: Changing vdf data sources from Excel using dll

Posted: Sat Dec 21, 2019 11:49 pm
by drw
That's great news. Thanks.