HydroCAD® Stormwater Modeling - Since 1986
|
HydroCAD Command-Line OptionsProjects are normally opened by using the Project|Open command on the HydroCAD main menu. You can also select a project file directly in Windows, which causes HydroCAD to launch and open the specified file. For special applications, you can also invoke HydroCAD using the Windows command line. Special command-line options are also available to automatically add, merge, or calculate a project. These can be used in a batch file to automate a specific process, or by another program that needs to interact with HydroCAD. You can also create a windows shortcut to perform a specific sequence of operations that is used repeatedly. Basic CommandsStarting HydroCADTo launch HydroCAD from a command line, specify the program location and name, such as: "C:\Program Files\HydroCAD\HydroCAD.exe" Quotes are required if the file name contains separators, such as spaces. Be sure to specify the actual folder in which HydroCAD is installed. Although most installations will use the default folder shown in this example, the user may have selected a different drive or folder at the time of installation. The actual installation folder can be determined by reading the following registry key: HKEY_LOCAL_MACHINE\Software\HydroCAD\InstallDir1 Opening a ProjectTo open a specific file in HydroCAD, add the file name to the HydroCAD command shown above: "C:\Program Files\HydroCAD\HydroCAD.exe" "c:\MyFolder\MyProject"
To open multiple files, you can execute an additional command line for each file. Or you can include multiple file names on a single command line. Each project will be opened on a separate tab and the last project will be selected: "C:\Program Files\HydroCAD\HydroCAD.exe" "c:\MyFolder\MyProject" "c:\AnotherFolder\AnotherProject" Command-Line SwitchesSwitches are used to automate specific operations that would normally be executed by the user with the mouse or keyboard. They are generally used in combination with a basic command line, as discussed above. For example, to open a project and then close it, you could add the "Close" switch: "C:\Program Files\HydroCAD\HydroCAD.exe" "c:\MyFolder\MyProject" /C Although this might seem to be an unproductive command, if the auto-export options have been selected within the project file, they will be executed when the file is closed. This can be used to trigger the calculation and export of data for use by another program. See the Settings|Export screen for details. Basic Commands
{space}/C = Close the current project. This is the same as the Project|Close command. If the project has been modified, the user is asked for permission to overwrite the existing file. If the Silent switch is specified, the file is overwritten without prompting.
{space}/E = Exit from HydroCAD. This is the same at the Project|Exit command. If a project has been modified, the user is prompted to save the file. If the silent switch is specified, each file is overwritten without prompting.
{FileName}/A = Add the contents of the specified project to the current project. This is the same as the Project|Add command.
"C:\Program Files\HydroCAD\HydroCAD.exe" "c:\MyFolder\BaseFile" "c:\AnotherFolder\AddFile"/A {FileName}/M = Merge the contents of the specified project into the current project. This is the same as the HydroCAD Project|Merge command.
"C:\Program Files\HydroCAD\HydroCAD.exe" "c:\MyFolder\BaseFile" "c:\AnotherFolder\MergeFile"/M {space}/S = Silent mode. Prevents the prompts that might normally occur during the execution of the above commands. If a project has been modified, the previous file is automatically overwritten. When feasible, default file names are used instead of prompting for input. Since the silent command applies only to subsequent commands on the same line, it is generally placed at the beginning of the line, as shown below in the multi-option example. Import/Export Commands
{FileName}/XA = Export Subarea data for the current project to the specified file. This is equivalent to the Export|Subareas command. {FileName}/XF = Export Flow Segments for the current project to the specified file. This is equivalent to the Export|Flow Segments command. {space}/XS = Export Subcatchment data for the current project to default files. This is equivalent using the /XA and /XF switches at the same time, or to the Export|Subcatchment command. {FileName}/IA = Import Subarea data into the current project from the specified file. This is equivalent to the Import|Subareas command. {FileName}/IF = Import Flow Segments into the current project from the specified file. This is equivalent to the Import|Flow Segments command. {space}/IS = Import Subcatchment data into the current project from default files. This is equivalent to using the /IA and /IF switches at the same time, or to the Import|Subcatchment command. {space}/IW = Import Watershed data according to the options on the Settings|Watershed screen. This is equivalent to the Import|Watershed command.
Other Commands /H = Halt any active HydroCAD session. This command is available only in HydroCAD 10.2-4b and later. It can be used to terminate a HydroCAD session that may have been left running inadvertently. This command is suitable for use in a Windows shutdown or log-off script. The following command format is recommended:
Note: Using the "/W" option ensures that the command will wait until the session has been fully closed and HydroCAD is no longer running. The log-off or shutdown script can then continue. Using multiple optionsTo perform more complex operations, you can combine multiple command line option. This example will open a base file, merge updated information from a second file, save the updated file (performing any auto-export), and exit from HydroCAD, all without any user prompting: "C:\Program Files\HydroCAD\HydroCAD.exe" /S "c:\MyFolder\BaseFile" "c:\AnotherFolder\MergeFile"/M /C /E For additional details, read about HydroCAD startup.
|
|