Generate VBA: Assembly Mates
generate_vba_assembly_matesGenerate VBA macro code to add concentric, distance, parallel, perpendicular, or coincident assembly mates between selected faces or edges in SolidWorks.
Instructions
Write a VBA macro that adds a concentric, distance, parallel, perpendicular or coincident mate between two selected faces or edges.
To add a mate directly, use add_mate. 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 faces must be selected in SolidWorks 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_assembly_mates"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | A mapping with `mate_type` (default "concentric"), `component1` and `component2` (names, for the comments), and `distance` in mm for a distance mate. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||