Execute Solidworks Script
execute_solidworks_scriptExecute custom Python CAD code against the live SolidWorks COM API to build mathematical curves, airfoils, complex lofts, and specialized mechanical geometry.
Instructions
Executes custom Python CAD code directly against the live SolidWorks COM API. Variables available in scope: swApp, model, part, sketch_mgr, feat_mgr, sel_mgr, ext, mm_to_m, m_to_mm, math. Ideal for custom mathematical curves, airfoils, complex lofting, or specialized mechanical geometry.
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": {
"python_code": "<python_code>"
},
"name": "execute_solidworks_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| python_code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||