Script
set(param)
Creates a dynamic ccscript and sets its code to the given data or file.
Kind: v1.script function
Returns: object - object containing result and optional messages
{
result: { name: string } // object containing the clean name of the created ccscript
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
| Param | Type | Description |
|---|---|---|
| param | object | The object containing all parameters. |
| param.name | string | The name of the ccscript to create and set. |
| [param.data] | string | The code to use as body of the created ccscript. |
| [param.file] | string | The full path to a file. Path has to be a for the ClassCAD process reachable local or UNC path. |
| [param.encoding] | "base64" | the encoding the data is encoded with. If compression is also set, the decoding happens first! |
| [param.compression] | "deflate" | the compression algorithm the data is compressed with. |
Example
api.v1.script.set({ name: 'getData', file: '/var/models/file.ccscript' })
run(param)
Runs the given ccscript definition. If only the 'name' is provided, the ccscript has to exist already created by using @see set.
Kind: v1.script function
Returns: object - object containing result and optional errors
{
result: any | VOID // The result of the executed ccscript will be returned. Is is unknown at this location.
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
| Param | Type | Description |
|---|---|---|
| param | object | The object containing all parameters. |
| [param.scriptParam] | object | The parameters object forwarded to the executed ccscript. |
| [param.name] | string | The name of the ccscript that has been defined by calling @see set. |
| [param.file] | string | The full path to a file. Path has to be a for the ClassCAD process reachable local or UNC path. |
| [param.data] | string | The code to use as body of the created ccscript. |
| [param.encoding] | "base64" | the encoding the data is encoded with. If compression is also set, the decoding happens first! |
| [param.compression] | "deflate" | the compression algorithm the data is compressed with. |
Example
api.v1.script.run({ name: 'getData' })