IApplication.ExecuteScriptCode(string,string,string,IScriptParams) Method
Namespace: NextDesign.Desktop
Description
Executes the given script code.
By specifying basePath, you can use relative paths for external files used within the script code.
If not specified, the project file path is used as the starting point for searching for external files, provided the currently open project is saved.
Argument
| Name | Type | Description |
|---|---|---|
| code | string | Script code |
| lang | string | Scripting language - "cs": C# - "py": Python |
| basePath | string | Path to which external files are searched (if null, the folder where the project file is stored) |
| scriptParams | IScriptParams | Script parameters |
Return value
- object
Exception
| Name | Exception class | Description |
|---|---|---|
| Invalid argument | ExtensionArgumentException | When a string not corresponding to the scripting language is specified |
| Script execution failed | ExtensionScriptException | When script execution fails (InnerException allows access to the exception that caused the failure) |
Annotation
The script's return value is the result object of the script's return statement.
If the script does not contain a return statement, it will return null.