Page 1 of 1
Vensim dll
Posted: Thu May 28, 2009 4:03 pm
by francapita2
I am developing a C++ project to show and represent Vensim simulation results. I do not need to simulate from this program just to represent results.
Our filesystem have the "&" character into filenames and folder names. When I try to open a model calling vensim_command from my C++ application and the model name or the folder name has the "&" character, vensim does not find the model to open.
On 21-11-2008 propose a solution by saying this:
This will be in the next release and done by using quotes around options as in
SPECIAL>LOADMODEL|"c:\vensim\projects\prueba&veras\empty.vpm"
so in C the command would be
vensim_command("SPECIAL>LOADMODEL|\"c:\\vensim\\Projects\\prueba&veras\\empty.vpm\"")
But I can not fix the problem. If I do this, the path change:
can not open C: / Vensim / C: / Archivos de programa/Vensim/samples/bpr3.vpm
How can I solve this?
Posted: Fri May 29, 2009 10:26 am
by bob@vensim.com
Is
vensim_command("SPECIAL>LOADMODEL|\"c:\\vensim\\Projects\\prueba&veras\\empty.vpm\"")
the exact command you are using?
Are you using version 5.9?
Posted: Fri May 29, 2009 11:45 am
by francapita2
HI BOB ;
I AM USING VENSIM VERSION 5.9.
AND MY COMMAND IS
vensim_command("SPECIAL>LOADMODEL|\"c:\\vensim\\prueba&veras\\BPR3.vpm\"")
BUT THE DIALOG BOX PUTS CAN NOT OPEN c:/vensim/c:/vensim/prueba&veras\\BPR3.vpm
HOW YOU SEE IT IS A DIRECTORY DUPLICATED; c:vensim/c:/vensim/........
I don“t know what is the problem.
Thank you very much by your help
bye bob
Posted: Fri May 29, 2009 2:33 pm
by bob@vensim.com
Try
vensim_command("\"SPECIAL>LOADMODEL|c:\\vensim\\prueba&veras\\BPR3.vpm\"")
to see if that works.
Posted: Mon Jun 01, 2009 10:08 am
by francapita2
Thank you BOb; but it does not work.
when I puts this:
vensim_command("\"SPECIAL>LOADMODEL|c:\\vensim\\prueba&veras\\BPR3.vpm\"")
Mi program load the model but it cannot be simulated and it has not turned out that to show.
Already not that to put.
Excuse me for the inconveniences.
You would have another solution
Thank you
Posted: Tue Jun 02, 2009 10:01 am
by bob@vensim.com
Both the loading and simulation work fine for me. I suspect the simulation difficulty is related to some other problem and not the name of the path the .vpm file is located in.
Posted: Tue Jun 02, 2009 3:52 pm
by francapita2
Thank you very much bob.
Thanks to your help I could have corrected my mistake.
Sincerely thank you very much
Posted: Tue Jun 02, 2009 4:02 pm
by francapita2
Hi Bob;
Sorry again but I have another question.
when my program tries to open a model mdl. or VMF. with vensim 5.9 a message appears saying:
the model ... ....... ... .. need published model ..........
To fix this I use the command FILE> PUBLISH but does not create the file. vpm and I do not know why?
do you know???
Thank you
Posted: Wed Jun 03, 2009 9:39 am
by bob@vensim.com
The model must be published from within Vensim DSS. You can use the FILE>PUBLISH command from a command script run by Vensim DSS but it is not valid for the DLL.
Posted: Wed Jun 03, 2009 11:12 am
by francapita2
hi bob.
I am trying to make a script called publicar.cmd and write in:
SPECIAL> LOADMODEL|C:\ ......\AGE.MDL
FILE> PUBLISH|C:\ .....\AGE.MDL
But it does not work. A message appears saying:
FILE> PUBLISH|C:\ .....\AGE.MDL failed
And not for that?
You can help me
Posted: Wed Jun 03, 2009 4:19 pm
by francapita2
Hello BOB;
FILE> PUBLISH needs a form file created from the publication dialog and then I need to enter in vensim.
But I want that my external program already does this and does not need to open vensim.
How I can do this, bob?
Posted: Thu Jun 04, 2009 9:35 am
by bob@vensim.com
You will first need to create the .frm file in Vensim (click on the Save... button on the File>Publish dialog). Once you have created that file you will need to copy it to the location of the model and use it with the FILE>PUBLISH command. The .frm file is a simple text file so if you want to modify it (eg by changing the model name) that is straightforward.
file frm
Posted: Mon Jun 08, 2009 9:07 am
by francapita2
Hello bob,
Already I have almost finished the changes of my program; nevertheless; I wanted to know if some command exists to create the file .frm without need to have to use the publication dialog
Thank you; bob
Posted: Mon Jun 08, 2009 10:52 am
by bob@vensim.com
You will need to use the publication dialog to get the form file - but can the modify the contents as I noted before.