simetrix.script.execute

simetrix.script.execute(script: str, arguments: list[ArrayLike | str | float | complex | GroupVector]) GroupVector

Execute a script and return a value.

Parameters:
  • command (str) – SIMetrix script name.

  • arguments – Arguments to the script. See details below.

Arguments Parameter

This is a list of up to 16 objects which can be any of these types:

  • Scalar integer, float, string or complex values. These can be literal constants or passed as a Python variable.

  • List of integer, float, string or complex values. These can be literal constants or passed as a Python variable.

  • simetrix.GroupVector object.

Any combination of the above items may be passed.

Unlike the runScript() function, arguments can only be passed by value. But the script called can return a value via the first argument.

In the SIMetrix script

Arguments @return_value arg1 arg2
Let return_value = [1,2,3,4]

The return value from execute will be the value assigned to return_value in the SIMetrix script. That is, [1,2,3,4] in the above example.