Command Line Options

From SysCAD Documentation
Jump to navigation Jump to search

Navigation: User Guide ➔ Command Line Options

Related Links: Command Scripts


Introduction

Command Line Options are additional flags and options which are added after the primary call of the command line which modify its execution. Command line options can be used:

  • in a desktop shortcut for SysCAD (appended to the Target field)
  • to run SysCAD from the command line (e.g. CMD, Command Prompt, DOS, Run, PowerShell, Terminal)
  • to run SysCAD from a batch (.bat) or command (.cmd) file

The SysCAD executable file is found in the bin folder. E.g. to start SysCAD from command line prompt or shortcut without any command line options (default install directory):

C:\SysCAD139\bin\SysCAD93.exe (note that ".exe" is usually optional)

If the command prompt is used often, the folder location of the SysCAD executable file can be added to the System PATH environment to avoid having to give the full path every time SysCAD is called.

Command Line Interface Syntax

Two syntax formatting styles are supported for command line interface (CLI):

  1. Microsoft style with use of '/' for options.
  2. Unix style with use of '-' or '--' for options. Available from Build 139.37043.

Command Line Options (Original)

This section describes the legacy Microsoft Windows style SysCAD Command Line Interface syntax. From Build 139.37043 it is recommended that the newer Unix style Command Line Options are used.

To call SysCAD with command line options:

C:\SysCAD139\bin\SysCAD93 [/n] [/rt] [/demo] [/l] [/p] [/nocloseprompt] [ProjectFolder] [*.ssc]

Notes:

  • All command line options are optional and may be in any sequence.
  • The options are all case sensitive and must be in lower case.
  • Any argument that is a string, such as a file/folder, may need to be enclosed in quotes. This is required if it contains spaces or special characters.
Options Short Description Description and Notes
/n New instance of SysCAD

Starts a new instance of SysCAD.
NOTE: If other command line options are included, this option is required to open a new instance of SysCAD. See Passing Options to an Open Copy of SysCAD.

/rt Runtime mode Starts a new instance of SysCAD in runtime mode, equivalent to using a Runtime License. This includes the "/n" option.
/demo Demonstration mode Starts a new instance of SysCAD in (unlicensed) Demo Mode. This includes the "/n" option.
/l License location Sets the SysCAD License Location for this instance of SysCAD, temporarily overriding the setting in License > License Location (saved in BaseFilesUser\SysCAD.Machine.ini). Option must be followed by a colon and the license folder path, e.g.:
/n /l:"C:\SysCAD139\ProBal License"
/n /l:"C:\SysCAD139\Dynamic License"

Useful for managing multiple license locations for a single SysCAD install. See Managing Multiple License Locations.
This option is usually used together with the "/n" option as shown in above examples.
NOTE: Ensure the full path for the license folder is given. Paths containing spaces or long filenames must be enclosed in quotes.

/p Prompt load of previous project

On start-up, a dialog prompt automatically appears with the option to load the most recent previous project.
This option can also be set on the General tab of the General Options dialog box.

/nocloseprompt Supress save prompt on close Supresses the prompt for project save when closing SysCAD.
Useful for automation scripts. Use with caution!
[ProjectFolder] Load project

Loads the project from the specified Project Folder path (usually ending ".spf"). It is not necessary to include the Project File (/Project.spj) as this is assumed.
If a project is found and loaded, any subsequent load project command line options would be ignored. The "/p" option is also ignored if a project is specified.
NOTE: Ensure the full path for the project folder is given. Paths containing spaces or long filenames must be enclosed in quotes.

[*.ssc] Run command script

Executes the specified Command Script(s) (*.SSC) in the order they are entered on the command line. A project must be loaded (either via the script, or as a separate command line option).
If the "/n" option is NOT included, SysCAD will look for an already running copy of SysCAD and if found pass the command script to that copy for execution, and if another copy is not found it will run the command script on the copy just started.
If command scripts include the Exit() command, then any subsequent script commands and files will NOT be executed as SysCAD will have closed.
NOTE: Ensure the full path for the command script file is given, including the .ssc extension. Paths containing spaces or long filenames must be enclosed in quotes.

Passing Options to an Open Copy of SysCAD

If there are no command line options, then a new regular instance of SysCAD is started.

If there are any command line options, then at start-up SysCAD will look for the first instance of SysCAD (with the same major Build number) which is already running and pass the command line options to that copy instead. This is primarily used for sending Command Script options to an open copy of SysCAD. All other command line options passed in this way are invalid or ignored. This is the default action unless the /n command line option is also included to start a new instance of SysCAD.

Examples

C:\SysCAD139\bin\SysCAD93 /n /l:"C:\Program Files\SysCAD License" Opens a new instance of SysCAD using the specified license
C:\SysCAD139\bin\SysCAD93 "C:\SysCAD139\Examples\40 Nickel\Demo Nickel Copper Project.spf" Opens SysCAD and loads the specified project (this will fail is SysCAD is already open)
C:\SysCAD139\bin\SysCAD93 "C:\SysCAD139\Examples\02 Features\Command Script Example.spf\project.spj" "C:\SysCAD139\Examples\02 Features\Command Script Example.spf\CommandScript\UsingExcelReport.ssc" Opens SysCAD, loads the specified project and runs the specified command script (this will fail is SysCAD is already open)

Note: A VBA (Visual Basic for Applications) Macro can also be set up in MS Excel to start SysCAD, load projects and run command script files. See Starting and Running SysCAD from MS Excel.

Command Line Options

This section describes the options, or syntax, for SysCAD Command Line Interface. This format is Available from Build 139.37043..

SysCAD Command Line options are based on typical Unix/Linux style Command Line Interface (CLI) conventions:

  • Short option flag: single hyphen (-) followed by a single letter. Example SysCAD93 -h
  • Short option with arguments: single hyphen (-) followed by a single letter then the argument separated by a space. Example SysCAD93 -s test.ssc
  • Long option flag: two hyphens (--) followed by an option name. Example SysCAD93 --demo
  • Long option with arguments: two hyphens (--) followed by an option name then the argument separated by a space. Example SysCAd93 --script test.ssc

Notes:

  • All command line options are optional and may be in any sequence.
  • The options are all case sensitive and must be in lower case.
  • Any argument that is a string may need to be enclosed in quotes. This is required if it contains spaces or special characters.
Option Argument Short Description Description and Notes
-p
--project
Project Filename Load project Load the SysCAD project for the specified project folder.

Paths containing spaces or long filenames must be enclosed in quotes.

-s
--script
Script Filename Run command script Executes the specified Command Script(s) (*.SSC) in the order they are entered on the command line. A project must be loaded (either via the script, or as a separate command line option).
--title Title text Set application title Prepends the specified title to the application. Useful to distinguish multiple instances of SysCAD. Can be used to identify a specific instance when passing commandline scripts to an open copy. The title text specified is reported by tag PlantModel.System.ApplicationTitle on Plant Model - System tab page.


Limited to 100 characters. Titles including spaces must be enclosed in quotes.

--send none Send commands Searches for an existing open copy of SysCAD and sends applicable command line options to the copy found. If a title is specified then the open copy must have a matching title. If a copy is found the current instance is closed after sending the commands. If a copy is not found then the commands are processed by the current instance.


Used to send a script to a specified open copy of SysCAD, or process directly if a copy is not found.

--sendrequired none Send commands and exit Searches for an existing open copy of SysCAD and sends applicable command line options to the copy found. If a title is specified then the open copy must have a matching title. If a copy is found the current instance is closed after sending the commands. Unlike the send command, if a copy is not found then the commands are ignored and the current instance is closed.


Used to send a script to a specified open copy of SysCAD.

--solverthreads N (Thread Count) Override flowsheet solver threads count Available from Build 139.37057. Override number of flowsheet solver threads for the application session. Temporarily overrides project settings for flowsheet solver threads. When N = 1 the "Single Threaded" option is used for $Solver.SolverThreadsRequired, and when N > 1 then "User Specified" option is used. The project $Solver.SolveThreads.Maximum is still applied. This applies to all projects that are loaded, and user project settings are not replaced with project save. A typical use would be for N=1 for simultaneously running multiple SysCAD instances at once using SysCAD Command Scripts.
-l
--license
License location Folder name Sets the SysCAD License Location for this instance of SysCAD, temporarily overriding the setting in License > License Location (saved in BaseFilesUser\SysCAD.Machine.ini). Useful for managing multiple license locations for a single SysCAD install. See Managing Multiple License Locations.


NOTE: Ensure the full path for the license folder is given. Paths containing spaces or long filenames must be enclosed in quotes.

--runtime none Runtime mode Starts SysCAD in runtime mode, equivalent to using a Runtime License.
--demo none Demonstration mode Starts SysCAD in (unlicensed) Demo Mode.

Passing Options to an Open Copy of SysCAD

The option flag -send or --sendrequired must be used to pass command line options to an open copy of SysCAD. With the use of the --title option a specific instance can be targeted by name.

Examples

C:\SysCAD139\bin\SysCAD93 /l:"C:\Program Files\SysCAD License" Opens a new instance of SysCAD using the specified license folder.
C:\SysCAD139\bin\SysCAD93 -p "C:\SysCAD139\Examples\40 Nickel\Demo Nickel Copper Project.spf" Opens SysCAD and loads the specified project.
C:\SysCAD139\bin\SysCAD93 -p "C:\SysCAD139\Examples\02 Features\Command Script Example.spf\project.spj" -s "C:\SysCAD139\Examples\02 Features\Command Script Example.spf\CommandScript\UsingExcelReport.ssc" Opens SysCAD, loads the specified project and runs the specified command script.

Registry Command Line Options

These commands can be used to register or unregister SysCAD Application COM Object and OPC Server. These commands are not case sensitive. Other copies of SysCAD should not be open when running these commands. User must be have administrative rights to run these commands. Please see Setting up SysCAD COM for instructions on how to run commands as an administrator. With these commands, an instance of SysCAD is not fully started and left open. If successful the registry is updated and no feedback is provided.

OPTIONS DESCRIPTION EXAMPLE / NOTE
/RegCOMServer Registers the SysCAD COM Application object C:\SysCAD139\bin\SysCAD93 /RegCOMServer
/RegOPCServer Registers SysCAD as OPC server C:\SysCAD139\bin\SysCAD93 /RegOPCServer
/RegServer Registers SysCAD COM and OPC C:\SysCAD139\bin\SysCAD93 /RegServer
/UnregCOMServer Unregisters the SysCAD COM Application object C:\SysCAD139\bin\SysCAD93 /UnRegCOMServer
/UnregOPCServer Unregisters SysCAD as OPC server C:\SysCAD139\bin\SysCAD93 /UnRegOPCServer
/UnregServer Unregisters SysCAD COM and OPC C:\SysCAD139\bin\SysCAD93 /UnRegServer