Remote Control Overview
This section introduces the remote-control command-line workflow for hfVisualizer and hfSectionVisualizer.
This document is written for users who want to control hfVisualizer or hfSectionVisualizer from the command line.
Use remote-control commands when you want to:
- control an already running viewer instance
- automate repetitive GUI actions
- save repeatable command sequences as scripts
- avoid opening interactive dialogs during batch work
1.1 Quick Start
If you only need the fastest path:
- start the application normally
- run
listorstatus opena file or connect to the active document- run display, selection, preprocessing, or postprocessing commands as needed
saveor export results
1.1.1 Launch the application normally
hfVisualizer.exe [file]
hfSectionVisualizer.exe [file]
1.1.2 Send a command to a running instance
hfVisualizer --remote [--target <id>] [--timeout-ms <ms>] <command> [args]
hfSectionVisualizer --remote [--target <id>] [--timeout-ms <ms>] <command> [args]
- In remote-control commands,
<id>means one target-instance identifier fromlist. - The recommended form is the full
uuidshown in the first column oflist. - A unique uuid prefix or the full
servername also works, but the full uuid is the clearest and safest choice when multiple instances are running.
1.1.3 Typical first commands
hfVisualizer --remote list
hfVisualizer --remote target set 60bae260-bf0a-4ad1-86ae-e9ef22bc8133
hfVisualizer --remote status
hfVisualizer --remote open D:\Work\model.inp
hfVisualizer --remote save
1.2 Common Workflow Rules
1.2.1 Choosing the target window
- Use
hfVisualizer --remote target set <id>when you want repeatedhfVisualizer --remote ...commands to keep using the same running instance. - Use
hfSectionVisualizer --remote target set <id>when you want repeatedhfSectionVisualizer --remote ...commands to keep using the same running instance. - Use
hfVisualizer --remote target showto inspect the saved default target, orhfVisualizer --remote target clearto remove it. - Use
hfSectionVisualizer --remote target showto inspect the saved default target, orhfSectionVisualizer --remote target clearto remove it. - Use
--target <id>when you want to override the saved default target for one command, or when you do not want to save a default target. <id>is one target-instance identifier fromlist.- The recommended
<id>is the fulluuidshown in the first column oflist. - A unique uuid prefix or the full
servername fromlistalso works. - When more than one instance is running, prefer the full uuid or a long enough unique prefix instead of a very short prefix.
- For
hfVisualizer, if--targetis omitted and a saved default target exists, that saved target is used first. - For
hfSectionVisualizer, if--targetis omitted and a saved default target exists, that saved target is used first. - If no saved default target exists and exactly one instance is running, that instance is used automatically.
- If multiple instances are running and neither
--targetnor a saved default target is available, the command fails so that it does not affect the wrong window. - If the saved default target no longer exists, the command fails and asks you to run
target clearortarget setagain instead of guessing another window. target set/show/clearare local client commands for both apps. They do not send remote-control requests to the GUI process.
hfVisualizer --remote target set <id>
hfVisualizer --remote target show
hfVisualizer --remote target clear
hfSectionVisualizer --remote target set <id>
hfSectionVisualizer --remote target show
hfSectionVisualizer --remote target clear
target set <id>:- resolves one live app instance from the full uuid, a unique uuid prefix, or the full server name shown by
list - stores that instance as the local default target used when
--targetis omitted later target show:- prints JSON showing whether a default target is saved
- reports
resolved: truewhen the saved target still matches a live instance - reports
resolved: falsewith an error when the saved target is stale target clear:- removes the saved default target
- Target resolution order for normal
hfVisualizer --remote ...commands: - explicit
--target <id> - saved default target from
target set - automatic single-instance selection when exactly one instance is running
- otherwise fail instead of guessing
--target <id>remains available as a one-command override even aftertarget set.
Examples:
hfVisualizer --remote list
hfVisualizer --remote target set 60bae260-bf0a-4ad1-86ae-e9ef22bc8133
hfVisualizer --remote target show
hfVisualizer --remote status
hfVisualizer --remote --target 864937a3-0922-4a0c-b377-9a2ec5c10d82 status
hfVisualizer --remote target clear
hfSectionVisualizer --remote list
hfSectionVisualizer --remote target set 4d2f7aa1-5f6d-4e23-9c62-6a63dc7f914b
hfSectionVisualizer --remote target show
hfSectionVisualizer --remote status
hfSectionVisualizer --remote --target 7f3f8f20-8a68-4d3c-bd8d-3e6c6d7f0b12 status
hfSectionVisualizer --remote target clear
1.2.2 File path behavior
- Absolute paths are used as-is.
- Relative paths are resolved from the top-level CLI working directory.
- If a command needs a save path but the current document has never been saved, it fails with
SAVE_PATH_REQUIRED. - The remote CLI receives arguments after PowerShell or
cmd.exehas already split the command line into tokens. - Double quotes are not part of the final value. They only keep one shell argument together.
- If one argument contains no spaces, quoted and unquoted forms are normally equivalent. This applies to
select node,select element,select surface,select edge, and other commands in the same way. - Use double quotes when one argument itself contains spaces, such as
--content "..."or a file path with spaces. Quotes may also be kept for readability even when they are not strictly required.
1.2.3 Non-interactive behavior
- Remote-control commands are designed for automation and must not open modal dialogs.
- If user input would normally be required in the GUI, the remote-control command fails instead of prompting.
1.2.4 Working with scripts
<app> --remote [--target <id>] [--timeout-ms <ms>] script <file>
<app> --remote [--target <id>] script-save [file]
- A script file contains one command tail per line.
- Do not include
<app> --remotein the script file. - Do not include
--target <id>in the script file. Target selection is resolved by the outerscriptcommand. - For
hfVisualizerandhfSectionVisualizer,target set/show/clearare local client commands and are not valid inside a script file. - Blank lines and
#comment lines are ignored. - Nested
scriptinside a script file is not allowed. scriptis fail-fast: it stops on the first failed line.
1.2.5 Session and history files
- Runtime files are stored under
<sessionRoot>/.hyfeast/. - Default history/script files:
hfVisualizer:<sessionRoot>/.hyfeast/hfVisualizer.<uuid>.ipc.txthfVisualizerlocal default target:<sessionRoot>/.hyfeast/hfVisualizer.defaultTarget.jsonhfSectionVisualizer:<sessionRoot>/.hyfeast/hfSectionVisualizer.<uuid>.ipc.txthfSectionVisualizerlocal default target:<sessionRoot>/.hyfeast/hfSectionVisualizer.defaultTarget.jsonscript-savewrites command tails in the same format accepted byscript.
1.2.6 Exit codes
hfVisualizerandhfSectionVisualizeruse the same remote CLI exit-code values.- Success:
0 - Invalid arguments or usage:
2 - Target selection failure:
3 - Remote-control connection failure:
4 -
Remote-control timeout:
5 -
When a command fails, the CLI normally prints an error line such as
ERROR[...]and also returns a non-zero exit code. - For example, if
hfVisualizer --remote newfails withSAVE_PATH_REQUIRED, the console shows the error text and the exit code is still2.
Check the exit code in cmd.exe:
hfVisualizer --remote new
echo %ERRORLEVEL%
Check the exit code in PowerShell:
hfVisualizer --remote new
$LASTEXITCODE
The same pattern applies to hfSectionVisualizer:
hfSectionVisualizer --remote status
echo %ERRORLEVEL%