Scripting outside of MIKE Workbench¶
Third party python environments¶
MIKE Workbench comes with the Script Manager that allows users to have an integrated scripting experience. Tools and Data can be easily integrated into scripts that can be debugged directly from MIKE Workbench.
Some more advanced scripter prefer third party scripting environment (e.g. Visual Studio Code). This is possible but the native integration with MIKE Workbench is then lost. To script outside of MIKE Workbench, the Application object needs to be instantiated. The script below shows how this is done:
import clr
clr.AddReference("DHI.Solutions.Application")
from DHI.Solutions.Application import *
dbflavour="PostgreSQL"
dbhost = "localhost"
dbport = "5432"
dbuser = "MyUserName"
dbpw = "MyPassword"
dbname = "MyDatabaseName"
app = Application()
cnn = r"Host="+dbhost+";Database="+dbname+";Port="+dbport+";dbflavour="+dbflavour
app.SetConnection(cnn);
app.Login(dbuser, dbpw, "workspace1");
app.StartUp();
MIKEOPERATIONSPY¶
MIKEOPERATIONSPY will be released with MIKE OPERATIONS 2025.3 version in August 2025.