Generate VBA: Batch Export
generate_vba_batch_exportGenerates VBA macro code that batch exports every matching SolidWorks file in a folder to STEP copies in a target folder, with optional recursion and exclusion lists. Returns code to paste into the VBA editor.
Instructions
Write a VBA macro that opens every matching file in a folder and saves a STEP copy of each to another folder.
To export one file directly, use export_step. The macro comes back as text for
the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp
files, so it can't run this directly. Read-only. Nothing runs in SolidWorks.
Returns: vba_code, the parameters used and usage_instructions.
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": "generate_vba_batch_export"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | The batch. Give `operation_type` (e.g. "export"), `file_pattern` (e.g. "*.sldprt"), `source_folder` and `target_folder`; `recursive` defaults to on. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||