Generate VBA: File Operations
generate_vba_file_operationsGenerates VBA macro code to set a custom property across every configuration or run Pack and Go on the active SolidWorks document, returning ready-to-paste code for the VBA editor.
Instructions
Write a VBA macro that sets a custom property in every configuration, or runs Pack and Go on the active document.
To set a property directly, use set_custom_property; for Pack and Go, use
pack_and_go_assembly. 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_file_operations"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | A mapping with `operation`: "custom_properties" (the default, with `property_name` and `property_value`) or "pack_and_go" (with `target_folder`). Any other operation is refused. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||