execute_macro
Run binary SolidWorks macros (.swp or legacy .swb) through COM to automate CAD tasks; rejects VBA source files and requires non-interactive macros.
Instructions
Run a binary SolidWorks macro (.swp, or legacy .swb).
Calls ISldWorks::RunMacro2 on macro_path (or macro_file).
Only binary macros run: VBA source (.vb, .bas, plain text) is
rejected as invalid_input before anything reaches SolidWorks.
The macro must not be interactive (no MsgBox or user forms).
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": {
"input_data": "<input_data>"
},
"name": "execute_macro"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | The input data value. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||