run_vba_macro
Execute a VBA macro in SolidWorks by specifying the macro path, module, procedure, and arguments to automate CAD tasks.
Instructions
Execute a VBA macro in SolidWorks
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>",
"procedureName": "<procedureName>"
},
"name": "run_vba_macro"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macroPath | Yes | Full path to the macro file (.swp or .swb) | |
| moduleName | No | Module name containing the procedure | Module1 |
| procedureName | Yes | Procedure name to execute | |
| arguments | No | Arguments to pass to the macro |