Generate VBA: Insert Component
generate_vba_assembly_insertGenerate VBA macro code that inserts a component into the active SolidWorks assembly at a specified point and rotation for pasting into the VBA editor; no code runs.
Instructions
Write a VBA macro that inserts a component into the active assembly at a point.
To insert a component directly, use insert_component. 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_assembly_insert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | The component. Give `component_path` (the .sldprt or .sldasm); `insertion_point` and `rotation` default to the origin. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||