Hi there,
I'm trying to set up a script to "automatically" publish a .mdl file using Vensim DLLs.
After having been through the Vensim documentation, I thought I should use the Venapp Commands through but I could not find one that converts a mdl to a vpmx file.
Could you please kindly indicate me what is the right way to perform this action?
Thanks a lot,
Paul
How to publish a model using DLLs?
-
- Junior Member
- Posts: 4
- Joined: Wed Nov 14, 2018 5:00 pm
- Vensim version: DSS
-
- Super Administrator
- Posts: 4600
- Joined: Wed Mar 05, 2003 3:10 am
Re: How to publish a model using DLLs?
You'll need to set up a form for publishing, and then us that when calling
FILE>PUBLISH|frmfile
https://www.vensim.com/documentation/25033.html
FILE>PUBLISH|frmfile
https://www.vensim.com/documentation/25033.html
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Junior Member
- Posts: 4
- Joined: Wed Nov 14, 2018 5:00 pm
- Vensim version: DSS
Re: How to publish a model using DLLs?
Thank you very much for your reply.
I made a series of tests but I have not been able to make it work, i.e. publish the IND_2023_Master.mdl to IND_2023_Master.vpmx.
Here is the Vensim version I use: DSS 9.2.3 x64, Build TK-220328.00133, on Windows 10 22H2.
And below is the VB code I tried
With DocumentsVensimScript.cmd as
and IND_master.frm as
By the way, when running the VB script below
I got the following error whereas, from the documentation, I understood that "You can load both text format model (.mdl files) and binary format models (.vmf) files as well as packaged models." Not sure if there is link, but I preferred to flag
Thanks a lot for your help,
Paul
I made a series of tests but I have not been able to make it work, i.e. publish the IND_2023_Master.mdl to IND_2023_Master.vpmx.
Here is the Vensim version I use: DSS 9.2.3 x64, Build TK-220328.00133, on Windows 10 22H2.
And below is the VB code I tried
Code: Select all
'Option Explicit
Public Declare PtrSafe Function vensim_command Lib "vendll64.dll" (ByVal Vcommand$) As Long
Sub Publish_Vensim_Model()
Dim bln_return As Integer
Dim strCmd As String
bln_return = 1
strCmd = \\path\DocumentsVensimScript.cmd
bln_return = vensim_command(strCmd)
End Sub
Code: Select all
SPECIAL>LOADMODEL|G:\EO2023\Model\Demand\_Master\IND\blank.vpmx
FILE>PUBLISH|IND_master.frm
Code: Select all
PublishSettings
561
1,0,0,0
0
1,1,1,1,1,1
0,0,0,0
Vensim® DSS Version 9.2.3 x64 (x64), Build : TK-220328.00133 Serial #1694002 Windows 8 (or greater)
IND_2023_Master.vpmx
IND_2023_Master.mdl
Code: Select all
Sub Publish_Vensim_Model()
Dim bln_return As Integer
Dim strCmd As String
bln_return = 1
strCmd = "SPECIAL>LOADMODEL|G:\EO2023\Model\Demand\_Master\IND\IND_2023_Master.mdl"
bln_return = vensim_command(strCmd)
End Sub
Thanks a lot for your help,
Paul
-
- Super Administrator
- Posts: 4600
- Joined: Wed Mar 05, 2003 3:10 am
Re: How to publish a model using DLLs?
Sorry, I misunderstood your first mesage.
No, you cannot do this via the DLL. The DLL will only open published models, so there is no way to get the MDL file into the DLL in order to publish it. You need to run these commands in Vensim via a command script.
No, you cannot do this via the DLL. The DLL will only open published models, so there is no way to get the MDL file into the DLL in order to publish it. You need to run these commands in Vensim via a command script.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559