run_macro
Execute a SolidWorks macro file (.swp or .swb) to automate CAD tasks by specifying the macro path, module, procedure, and optional arguments.
Instructions
Run a SolidWorks macro file
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": {
"macroPath": "<macroPath>"
},
"name": "run_macro"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macroPath | Yes | Full path to the macro file (.swp or .swb) | |
| moduleName | No | Module name containing the macro | main |
| procedureName | No | Procedure/subroutine name to run | main |
| arguments | No | Arguments to pass to the macro | |
| unloadAfterRun | No | Unload macro from memory after execution |