replace_component
Replace a top-level assembly component with another part or assembly file while preserving its position and reporting kept, broken, or lost mates.
Instructions
Replace a top-level component of the active assembly by another part or assembly file. SolidWorks keeps the component's place and re-attaches the mates it can; nothing is fixed silently: the result lists every mate as kept, broken (with its error) or gone, and the new component's name and position. all_instances (default false) replaces every instance of the same file; configuration is the new file's configuration (default its active one; the result says which). A file named like one already in use (another folder) is refused: SolidWorks cannot load both, so copy_file it to a new name first.
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": {
"component": "<component>",
"filepath": "<filepath>"
},
"name": "replace_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filepath | Yes | The part (.sldprt) or assembly (.sldasm) file to put in its place | |
| component | Yes | Top-level component name from list_components, e.g. Bracket-2 | |
| all_instances | No | Replace every instance of the component's file, not only this one | |
| configuration | No | Configuration of the new file (default its active one) |