About this Block
What it does: The Run Command block allows users to run any command-line command directly within nTop. This block enables the execution of diverse external processes, such as executing complex simulations, interfacing with external design tools, or integrating manufacturing processes. Common uses:- Connecting applications: Any command line executables of design, analysis, or manufacturing software and tools
- Automation: Execute Command Line or PowerShell commands for automation.
- Scripting: Execute commands in Python, Lua, or any other scripting language you choose.
- Permission Setting for Run Command blocks
- nTop will prompt you with a Security Warning to trust Run Command blocks before allowing them to run because Run Commands could contain security hazards. You can select the preference of your permission setting from Settings > Data > Run Command (Beta). Learn more about the settings available Run Command Permission Settings.
- Working Directory Input
- The Working Directory input lets you set a relative directory dynamically associated with the process.
- Note: The default Working Directory is not where your file is located. It is the directory of the parent process. This means the default directory depends on how nTop is opened; opening nTop from the standard installation will result in the directory “C:\Program Files\nTopology\nTopology”. This will be different if you open or execute the nTop Notebook via PowerShell. Running an external process through the default nTop directory could lead to library collisions.
- If you experience library collisions, please set a Working Directory manually.
- The Await block
- The Await custom block lets you pause and wait for a block completion before running the Run Command Block.
- In practical terms, utilizing the command input for the Run Command block ensures optimal functionality, allowing the Run Command block to patiently wait for the output from the Await block upon the Export Mesh’s completion.
- An example of this is when the execution of the Run Command Block is based on the completion of an Export Mesh block.
- The Await block contains two input variables of Any type to facilitate this synchronization.
- The first input, Await, is for the block awaiting completion. The second input, Return, is the output once the Await is completed.
Example File
Download Example: Run Command with Await This support article has different examples of using the Run Command block.Run an external command, capturing the exit code, standard output, and standard error.
Inputs
| Name | Type | Description |
|---|---|---|
| Command | Text | Command to execute. |
| Log output | Bool | If checked, write standard output to the nTop Log Panel. |
| Log error | Bool | If checked, write standard error to the nTop Log Panel. |
| Timeout | Scalar | Option to cancel execution if unfinished after a set time period. |
| Working directory | Path | Option to set a working directory for external command. |
Outputs
| Type |
|---|
| Command Output |

