Execute Mechanical Script
mechanical_scriptExecute custom IronPython scripts in ANSYS Mechanical to automate simulations, modify models, or extract data. Requires explicit confirmation for unsafe operations.
Instructions
Execute arbitrary Mechanical IronPython after explicit unsafe confirmation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script": "<script>",
"confirm_unsafe": "<confirm_unsafe>"
},
"name": "mechanical_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | ||
| timeout | No | ||
| confirm_unsafe | Yes | Explicit confirmation that arbitrary IronPython can modify Mechanical |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| tool | Yes | ||
| error | No | ||
| message | Yes |