Skip to content

Script Manager Tools

Properties of a tool can be found in the Properties Window in MIKE Workbench.

Script Execute Tool

Tool for executing a script.

Tool Info
Display Name Script Execute Tool
API Name Execute Script Tool
Tools Explorer /Data tools/Script Execute Tool
NuGet Package DHI.MikeOperations.ScriptManager.Tools.ScriptExecuter
Assembly name (.dll) DHI.Solutions.ScriptManager.Tools.ScriptExecuter.dll
API Reference DHI.Solutions.ScriptManager.Tools.ScriptExecuter.IScriptExecutorTool
Input Items No input items required
Output Items A results object

Tool Properties

Display Name API Name Description
Parameters
Script path ScriptPath Gets or sets the full path of the script to execute.
Script
Parameters Parameters Gets or sets the script parameters to use for executing the script.
Script Description ScriptDescription Gets the script description.

Code Sample

import clr
clr.AddReference("DHI.Solutions.ScriptManager.Tools.ScriptExecuter")
from DHI.Solutions.ScriptManager.Tools.ScriptExecuter import *

# Get the tool.
tool = app.Tools.CreateNew("Execute Script Tool")
# Add input items.
tool.InputItems.Add(<No input items required>)
# Set tool properties before executing the tool.
tool.Execute()
# Read the output from the list of output items.
output = tool.OutputItems
import clr
clr.AddReference("DHI.Solutions.ScriptManager.Tools.ScriptExecuter")
from DHI.Solutions.ScriptManager.Tools.ScriptExecuter import *

# Get the tool.
tool = DHI.Solutions.ScriptManager.Tools.ScriptExecuter.IScriptExecutorTool(app.Tools.CreateNew("Execute Script Tool"))
# Add input items.
tool.InputItems.Add(<No input items required>)
# Set tool properties before executing the tool.
tool.Execute()
# Read the output from the list of output items.
output = tool.OutputItems
// Get the tool.
var tool = application.Tools.CreateNew("Execute Script Tool") as DHI.Solutions.ScriptManager.Tools.ScriptExecuter.IScriptExecutorTool;
// Add input items.
tool.InputItems.Add(<No input items required>);
// Set tool properties before executing the tool.
tool.Execute();
// Read the output from the list of output items.
output = tool.OutputItems;

Runtime.config

What tools to load during application startup, is specified in the XML file Runtime.config in the plugins section of the manager.

The XML below shows the tool plugin information found in the Runtime.config file.

<Plugin
  Name="DHI.Solutions.ScriptManager.Tools.ScriptExecuter.ScriptExecuter"
  Type="DHI.Solutions.Generic.ITool"
  Assembly="DHI.Solutions.ScriptManager.Tools.ScriptExecuter.dll" />

Script Query Tool

Tool for querying scripts.

Tool Info
Display Name Script Query Tool
API Name Script query
Tools Explorer /Data tools/Script Query Tool
NuGet Package DHI.MikeOperations.ScriptManager.Tools.Query
Assembly name (.dll) DHI.Solutions.ScriptManager.Tools.QueryTool.dll
API Reference DHI.Solutions.ScriptManager.Tools.QueryTool.QueryTool
Input Items No input items required
Output Items List of results

Tool Properties

Display Name API Name Description
Query parameters
Author Author Gets or sets the the Author that scipts should be made by. Wildcards are supported.
Metadata Metadata Gets or sets the metadata limitting the search for scripts containing the specified metadata.
Note that the property is only available when: HasMetadataModule=True
Name ScriptName Gets or sets the name of scripts to query for.
Storage Storage Gets or sets the the Storage that a scripts should be within. Wildcards are supported.
Within Group WithinGroup Gets or sets the group name that scripts should be within. Wildcards are supported.

Code Sample

import clr
clr.AddReference("DHI.Solutions.ScriptManager.Tools.QueryTool")
from DHI.Solutions.ScriptManager.Tools.QueryTool import *

# Get the tool.
tool = app.Tools.CreateNew("Script query")
# Add input items.
tool.InputItems.Add(<No input items required>)
# Set tool properties before executing the tool.
tool.Execute()
# Read the output from the list of output items.
output = tool.OutputItems
// Get the tool.
var tool = application.Tools.CreateNew("Script query") as DHI.Solutions.ScriptManager.Tools.QueryTool.QueryTool;
// Add input items.
tool.InputItems.Add(<No input items required>);
// Set tool properties before executing the tool.
tool.Execute();
// Read the output from the list of output items.
output = tool.OutputItems;

Runtime.config

What tools to load during application startup, is specified in the XML file Runtime.config in the plugins section of the manager.

The XML below shows the tool plugin information found in the Runtime.config file.

<Plugin
  Name="DHI.Solutions.ScriptManager.Tools.QueryTool.QueryTool"
  Type="DHI.Solutions.Generic.ITool"
  Assembly="DHI.Solutions.ScriptManager.Tools.QueryTool.dll" />