Dynamo Command Line Interface
Why
You might want to control Dynamo from the command line for various reasons, these might include:
Automating many Dynamo runs
Testing of Dynamo Graphs (also look at -c when using DynamoSandbox)
Running a sequence of Dynamo graphs in a specific order
Writing batch files that run multiple command line executions
Writing another program to control and automate the running of Dynamo graphs and do cool things with the results of those computations
What
The Command Line Interface (DynamoCLI) is a supplement to DynamoSandbox. it is a dos/terminal command line utility designed to provide the convenience of command line arguments to run Dynamo. In its first implementation, it does not run standalone, it must be run from the folder where the Dynamo binaries reside, as it depends on the same core DLLs as the Sandbox. It can not interoperate with other builds of Dynamo.
There are four ways to run CLI: from a Dos prompt, from Dos batch files, and as a Windows desktop shortcut whose path is modified to include the specified command line flags. The Dos file spec can be fully qualified or relative, and mapped drives and URL syntax is supported as well. It can also be built with Mono and run on Linux or Mac from the terminal.
Dynamo packages are supported by the utility, however, you can not load custom nodes (dyf) only standalone graphs (dyn).
In preliminary testing, the CLI utility supports localized versions of Windows and you can specify filespec arguments with upper Ascii characters.
The CLI can be accessed through the DynamoCLI.exe application. This application lets a user or another application interact with the Dynamo evaluation model by invoking DynamoCLI.exe with a command string. This might look something like this:
This command will tell Dynamo to open the specified file at "C:\someReallyCoolDynamoFile.Dyn", without drawing any UI, and then run it. Dynamo will then exit when the graph has completed running.
New in version 2.1: The DynamoWPFCLI.exe application. This application supports everything that the DynamoCLI.exe application supports with the addition of the Geometry (-g) option. The DynamoWPFCLI.exe application is Windows only.
Important Notes
The preferred method of interacting with DynamoCLI is through a command prompt interface.
At this time you will need to run DynamoCLI from its install location inside the [Dynamo Version] folder. The CLI needs access to the same .dlls as Dynamo so it should not be moved.
You should be able to execute graphs that are currently open in Dynamo, but this may cause unintended side effects.
All file paths are fully dos compliant so relative and fully qualified paths should work, but be sure to enclose your paths in quotes "C:path\to\file.dyn"
DynamoCLI is new functionality and currently in flux: the CLI loads only a subset of standard Dynamo libraries at this time, note this if a graph does not execute correctly. These libraries are specified here
Currently no std output is provided if no errors are encountered, the CLI will simply exit after the run completes.
How
-o
you can open dynamo pointing to a .dyn, in a headless mode that will run the graph.
-v
can be used when Dynamo is running in a headless mode (when we have used -o
to open a file), this flag will iterate all nodes in the graph and dump their output values to a simple XML file. Because the --ServiceMode
flag can force Dynamo to run multiple graph evaluations, the output file will hold values for each evaluation that occurs.
The XML output file would have the form:
-g
can be used when Dynamo is running in a headless mode (when we have used -o
to open a file), this flag will generate the graph and then dump the resulting geometry into a JSON file.
The JSON geometry file would have the form:
-h
use this to get a list of the possible options
the -i flag can be used multiple times to import multiple assemblies which the graph you are trying to open requires to run.
the -l flag can be used to run Dynamo under a different locale setting. But usually, locale setting does not affect graph results
the --GeometryPath flag can be used to point DynamoSandbox or CLI to a specific set of ASM binaries - use it like
or
the -k flag can be used to leave the Dynamo process running until a loaded extension shuts it down.
the --HostName flag can be used to identify Dynamo variation associated with the host.
or
the -s flag can be used to identify Dynamo host analytics session id
the -p flag can be used to identify Dynamo host analytics parent id
Last updated