solidworks_script
Run Python scripts to automate SOLIDWORKS CAD/CAM operations, including assemblies, equations, and lengthy computations in background jobs.
Instructions
Execute trusted Python on the COM apartment (--allow-scripts required). Globals: sw, cad, cam, gateway, call(obj,member,*args), workspace, parameters. Assign result. Supports loops, equations, advanced features, assemblies and arbitrary add-ins. Full local code execution, not a sandbox. Prints are captured. Background jobs allow lengthy CAD/CAM computation.
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": {
"source": "<source>"
},
"name": "solidworks_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| background | No | ||
| parameters | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||