HEC-DSSVue allows the execution of scripts in interactive and batch modes.  Scripts are executed interactively by starting the HEC-DSSVue program and selecting the desired script from the Toolbar or the Script Selector from the Utilities menu.  Scripts are executed in batch mode by starting the HEC-DSSVue program with a script file name as a parameter (e.g. HEC-DSSVue.exe c:\test\myScript.py).  Scripts can be launched from the HEC-DSSVue program from the Script Menu, or from the Toolbar or from the Script Selector.

Interactive scripts are not passed any parameters upon script execution.  In a script executed interactively the variable sys.argv is a list of length one, with the only element set to the empty string (e.g., sys.argv = [" "]).

Scripts executed in batch mode may take parameters from the command line (e.g., HEC-DSSVue.exe c:\test\myScript.py a b c).  In a script executed in batch mode the variable sys.argv is a list whose length is one greater than the number of parameters passed on the command line, with the first element set to the file name of the executing script and the remaining elements set to the parameters (e.g., sys.argv = ["c:\\test\\myScript.py", "a", "b", "c"]).   Other specific examples are given below.


Example Script executionDescription
c:\programs\HEC-DSSVue-v3.2.5\jython.bat c:\project\Dssvue-example-scripts\src\BasicExamples\Example24-Plot-Dialog.pyrun from command line using a specific version of Hec-Dssvue
c:\programs\CWMS-v3.2.5\common\exe\runhere jython c:\project\Dssvue-example-scripts\src\BasicExamples\Example24-Plot-Dialog.pyusing runhere.exe include with CWMS.  runhere.exe ensures the working directory is the location of runhere.exe


Script Menu


The Script Menu can display a list of available scripts and execute a script by selecting it from the menu. 

Running Scripts from the Script Menu


The Script Menu, shown above, is not made visible on the main HEC-DSSVue menu bar until scripts are set to be displayed on the menu bar from the Script Editor, available from the Tools menu. To have a script displayed in the Script Menu, simply edit the script in the Script Editor, select the Show in Scripts Menu checkbox (below) 


Show in Scripts Menu Checkbox in Script Editor

Main Toolbar


The main toolbar can display buttons for all the available scripts which have the Display Script on Toolbar box checked in the Script Editor. Buttons are displayed in alphabetical order. After selecting the check box, the menu bar will look like it is shown below.





Script Selector

The Script Selector (below) displays buttons for all the available scripts which have the Display Script on Toolbar box checked in the Script Editor. Buttons are displayed in alphabetical order.
To access the Script Selector, select the Script Selector command from the Utilities menu of HEC-DSSVue. Once the Script Selector is open, it will remain open until you close it. When you press a button, the Jython script engine will execute the associated script.