Using ldcscript#
Command-Line#
ldcscript <project-file> [-script]:<Script> [ScriptOptions] [-cmd]:<Commands> -save:<optional-file-name>
- -script:<Script>
Run script with the given name
- -cmd:<Command>
Run Groovy API commands
- -save:<Filename used to save LDM file>
Save LDM file after execution.
Run specified groovy script. You can create and test a script using architect, but the script can then be run from ldcscript also. If a script has a user interface, the various elements of the user interface turn into script options.
Examples#
ldcscript -help
Dump out the arguments to ldcscript.
ldcscript -help:ScriptOpts
Dump out all the scripts you can run along with their arguments. Since each script will have its own arguments, this command is useful to discover the arguments to a script.
ldcscript project.ldz -script:DisplaySystemGraphviz.graph_circo
Runs the graph_circo method script in the file DisplaySystemGraphviz.groovy. If your file contains only one script, then just the file name is enough to invoke the script.
ldcscript project.ldz -cmd:"def model=getModel(); def root=model.getRootPartition(); model.expandMembers(root);" -save
The -cmd argument will allow the execution of groovy code directly, using the Lattix API. The -save argument will save the LDM file after execution.
ldcscript project.ldz -cmd:"def model=getModel(); def root=model.getRootPartition(); model.expandMembers(root);" -save:NewProject.ldz
The -save:NewProject.ldz argument will save the LDM file after execution to a new ldz file.
Success or Failure#
Returns success or failure to the calling script, where failure is the inability to complete its processing.