HFSS includes line arguments that can be included when launching from a command line or terminal prompt. All command-line arguments are case-insensitive.
Command-line syntax
hfss <options> <run command> <project name/script name>
Run Commands
The following command line run commands are available in HFSS. Of the commands (Batch-Save, BatchSolve, RunScript, RunScriptandExit), one or none must be used as arguments after hfss. Links to the valid options for each run command are listed and/or linked to descriptions.
-BatchSave <project file name>
Saves a named project to the current version. This is primarily intended for converting version 9 projects to version 10 when you intend to subsequently run them on a Linux platform. The conversion from version 9 to version 10 must be done under Windows, HP, or Solaris before those projects can run on a Linux system. You can run this command with the -Iconic option, the -Logfile option, and the -ng option (no graphics).
-BatchSolve
By default, solve all adaptive setups, sweeps, as well as Optimetrics setups found in the project file. If parallel solve is possible, you can use the -Distribute option in conjunction with -BatchSolve. You can run this command with the -Iconic option, the -Logfile option, the - ng option (no graphics), and the -WaitForLicense option.
Additional parameters for batch solves include the following. It is good practice to put quotes around the path to the HFSS executable, and the full path to the project. This ensures that spaces in the path or project will not be an issue. The same is true of the design name, if there are indeed spaces. The quotes must enclose the entire argument including the Nominal or Optimetrics part.
[designName] - batch solve all setups for design with the name given under the project.
[designName]:Nominal - batch solve all nominal setups for design with the name given under the project.
[designName]:Optimetrics - batch solve all Optimetrics setups for design with the name given under the project.
[designName]:Nominal:[setupname] - batch solve the specified nominal setup for design with the name given under the project. The setupname is case insensitive.
[designName]:Optimetrics:[setupname] - batch solve the specified Optimetrics setup for design with the name given under the project.The setupname is case insensitive.
-Local | -Remote | -Distributed
Perform the -Batchsolve on a local machine, a remote machine, or as a distributed solve using a specified machine list (see below). The settings persist only for the current session.
-MachineList list=“<machine1>, <machine2>, ...” | file="<machine list file path> "
-MachineList file=“<machine list file path>”
You can use either form of the MachineList option to indicate the machine(s) on which to run a distributed batchsolve. The settings persist only for the current session.
When you use a file to define the machines available for a distributed solve you should list the machine addresses or names on separate lines:
192.168.1.1 192.168.1.2 (etc)
-MachineList num = <numb distributed engines>
In a scheduler environment, you can specify the number of distributed engines that should be used for distributed processing. In this case, you do not specify the machine names after the the flag because the names are provided by the scheduler. For example, in the Windows HPC environment, you can write the number of distributed engines as follows.
-machinelist num=4
-batchoptions “'<option1>' '<option2>'...”
All options that are specified through Tools>Options dialogs go to the user-level registry.
You can override such registry entries via the -batchoptions command line. These over-rides apply only to the current Desktop session. This feature is available for all desktop products. The registry setting overrides may be specified on the command line, or may be in a file with the file pathname specified on the command line. The -batchoptions com-mand line option is only valid for batch jobs; it is ignored if neither -BatchSolve nor -BatchSave command line options are specified.
The following examples use hfss, but this feature is available for all desktop products.
•
The registry path separator is the slash "/"•
Registry key pathnames are enclosed in single quotes•
Registry string values are enclosed in single quotes•
Backslashes in registry key values must be escaped with another backslashExample with registry settings specified in a file
hfss.exe -batchsolve -batchoptions filename projectname.hfss where file filename contains:
$begin 'Config'
'HFSS/Preferences/NumberOfProcessors'=4 'Desktop/ProjectDirectory'='C:/projects/test'
$end 'Config'
This command line overrides the values of the HFSS/Preferences/NumberOfProcessors and Desk-top/ProjectDirectory registry settings. These overrides apply only to the current hfss session.
•
The -batchoptions filename value must be enclosed in double quotes if it contains whitespace•
The $begin 'Config' and $end 'Config' lines are required-batchoptions Uses Relative Registry Paths
When using the -batchoptions command line option, the registry paths specified on the command line or in the batchoptions file are relative paths. The paths are relative to the current version of the current product. If the examples above are used with HFSS version 12.0, then the following table shows the relative and absolute paths of the registry overrides in the above examples.
When to Use the -batchoptions Desktop Command Line Option
Many analysis parameter settings may be done using the GUI. For example, a number of HFSS options may be set using the HFSS Options dialog box, which is brought up by the
Tools>Options>HFSS Options... menu item. These parameter settings include the following solver options (not a complete list):
•
NumberOfProcessors•
NumberOfProcessorsDistributed•
MemLimitSoft: (Desired RAM Limit)•
MemLimitHard: (Maximum RAM Limit)These values of these parameters are saved in the registry when HFSS is not running.
When running a batch analysis, these parameters will take the values from the registry. The Note
•
The -batchoptions filename value must be enclosed in double quotes if it containswhitespace
•
The $begin 'Config' and $end 'Config' lines are requiredRelative Path Absolute Path for HFSS 12.0
registry with values specified on the command line or in a file. The values specified using the -batchoptions command line option only apply to the batch job, and do not affect the parameter values in the registry. For example, you could specify the following command to ensure that this analysis uses 2 processors for distributed processing and 2 processors for non-distributed process-ing. If the -batchoptions value is not specified, then the number of processors for distributed pro-cessing or for non-distributed propro-cessing could be affected by an interactive HFSS job running on the same host as the same user.
You can monitor progress and messages on standard output, during non-graphical analy-sis. Progress, warning and info messages are logged to the standard output stream. Error and fatal messages are logged to the standard error stream. Schedulers intercept these streams and provide commands for display of this output - see individual scheduler docu-mentation for specifics.
Run the specified script and exit. You can use the -ScriptArgs option to add one or more arguments to this command. You can also use the -Iconic option, the -Logfile option, and the -WaitForLicense option.
<none>
If you do not specify a run command with hfss on the command line, you can still specify the -Help and -Iconic option.
<project file>
Open the specified project on start up. If -BatchSolve is also set, the project will be solved.
Options
The following options can be associated with one or more of the run commands.
-Distribute
Distribute a batch solve to multiple machines. This option must be combined with the -BatchSolve run command and must be specified before it in the command line. See Dis-tributed Analysis for more information on disDis-tributed analysis.
Example:
C:\HFSS\hfss.exe -distribute -batchsolve _
HFSSDesign1:Optimetrics:ParametricSetup1 "C:\Project1.hfss"
-Help
Open a window that displays the different command-line options. This is only used when none of the four run commands are used.
-Iconic
Run HFSS with the window iconified (minimized). This can be used with all or none of the run commands.
-LogFile <log file name>
Specify a log file (use in conjunction with -BatchSave or -BatchSolve or -RunScriptAn-dExit run commands). If no log file is specified, it will be written to the directory in which the script or HFSS project is located, with the name <project_name>.log.
-ng
Run HFSS in non-graphical mode (use along with -BatchSave or -BatchSolve run com-mands).
-WaitForLicense
Wait for unavailable licenses (use along with -BatchSolve or -RunScriptAndExit).
-ScriptArgs <scriptArguments>
Add arguments to the specified script in conjunction with -RunScript and -RunScrip-tAndExit.
Note The <project file> must be the last command line entry.
ScriptArgs looks at the single argument after it and uses those as script arguments. You can pass multiple arguments to scriptargs by surrounding the script arguments in double quotes.
For instance:
hfss -scriptargs "HFSSDesign1 Setup1" -RunScriptAndExit c:\temp\test.vbs
Here, HFSSDesign1 is taken into HFSS as the first argument, and Setup1 is the second argument. Without the quotes, HFSSDesign1 is taken as the first argument, and Setup1 will not be understood by HFSS.
hfss -scriptargs HFSSDesign1 Setup1 -RunScriptAndExit c:\temp\test.vbs
Example:
c:\hfss\hfss.exe -runscriptandexit "c:\project1.vbs"
-scriptargs "Setup1"
Example:
C:\hfss\hfss.exe -RunScriptAndExit C:\scripts\test.vbs _ -scriptsargs "arg1 arg2 arg3"
Related Topics Running a Script.
Windows® HPC Task Properties
Command Line Enhancements for Ansoft Desktop Products