Tutorial 07
Scripts and Automation
Goal
This tutorial explains how to save repeated work into files and replay it later.
Main topics:
scriptscript-savetarget set- fail-fast behavior
1. Group repeated work into scripts
If the same review sequence must be repeated, store it in a file.
Execution:
hfVisualizer --remote script D:\Work\review.ipc.txt
2. Use target set for the default instance
If you do not want to repeat --target <id> every time, set the default target first.
hfVisualizer --remote list
hfVisualizer --remote target set 8f6d1c2b
hfVisualizer --remote script D:\Work\review.ipc.txt
Important:
target setis not a command inside the script file- it is configured outside the script, at the CLI level
3. A script file contains command tails only
Inside the script file, do not repeat hfVisualizer --remote.
Example review.ipc.txt:
open D:\Work\frame.h5.hdb
camera fit
representation both
display-control grid off
write-scene D:\Work\frame.png
4. script-save records the current workflow
hfVisualizer --remote script-save D:\Work\last-session.ipc.txt
This stores the canonical command tails from the current session into a *.ipc.txt file.
The saved file can later be replayed with script.
5. Remember that scripts are fail-fast
Scripts run in fail-fast mode by default.
That means:
- if any command in the file fails
- execution stops at that point
For that reason, a good script usually:
- stabilizes the target model and view state near the top
- places exports and screenshots near the end
6. Think about --view-id per command
Some script lines may need to target a specific render view.
When that happens, first confirm in the Remote Control manual whether that command supports --view-id.
For early scripts, it is usually best to keep things simple and stay on the default activeRenderView.
7. Recommended workflow
- perform the task once in the GUI or CLI
- save the sequence with
script-save - review the saved
*.ipc.txtand remove unnecessary lines - rerun it later with
script
Related documents
Next step
- Continue with Tutorial 08 - Portal Frame for a practical beam-frame example