Generate VBA: Drawing Views
generate_vba_drawing_viewsGenerates VBA macro code to place a model's standard front, top, and right views on the active SolidWorks drawing; returns the code for the VBA editor.
Instructions
Write a VBA macro that places a model's standard views (front, top, right) on the active drawing.
To make a drawing directly, use generate_drawing_package or
create_drawing_view. 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_drawing_views"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | The views. Give `model_path` (the model to draw); `scale`, `sheet_format` and the view layout have defaults. The drawing must be open and active when the macro runs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||