Generate VBA: Drawing Dimensions
generate_vba_drawing_dimensionsGenerates a VBA macro that adds a dimension to selected SolidWorks drawing entities and sets its precision for manual insertion into the VBA editor.
Instructions
Write a VBA macro that adds a dimension to the selected drawing entities and sets its precision.
To bring the model's dimensions into a drawing directly, use
insert_model_dimensions. 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. The entities must be selected before the macro runs. 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_dimensions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | A mapping with `dimension_type` ("linear", the default, "radial", "angular" or "diameter") and `precision` (decimal places, default 2). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||