add_component
Insert a saved part or sub-assembly into the active SOLIDWORKS assembly at specified X, Y, Z coordinates, with optional rotation about the assembly axes or a custom axis.
Instructions
Insert a saved part or sub-assembly file into the active assembly, with the centre of its bounding box at x, y, z. It can be rotated about that centre: rx, ry, rz in degrees (applied about the assembly X, then Y, then Z axis), or one turn given as axis plus angle. The first component inserted is fixed; later ones float until mated (add_mate). set_component_fixed changes that, and move_component repositions a floating one.
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": {
"filepath": "<filepath>",
"x": "<x>",
"y": "<y>",
"z": "<z>"
},
"name": "add_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X of where the component's center goes | |
| y | Yes | Y of where the component's center goes | |
| z | Yes | Z of where the component's center goes | |
| rx | No | Turn it by this many degrees about the assembly X axis | |
| ry | No | ... then about the assembly Y axis | |
| rz | No | ... then about the assembly Z axis | |
| axis | No | Instead of rx / ry / rz: the direction to turn about | |
| unit | No | mm, cm, m, inch or ft | |
| angle | No | With axis: degrees to turn | |
| filepath | Yes | Path of the .SLDPRT / .SLDASM file |