Export model to file
export_modelExports a Part Studio or Assembly to STEP, STL, Parasolid, or IGES on the server and returns the file path without modifying the document.
Instructions
Export a Part Studio or Assembly to a CAD/mesh file (STEP, STL, Parasolid, IGES) on the machine running this server and return the file path. Does not modify the document. STL sizes follow the configured unit system.
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": {
"document_id": "<document_id>",
"element_id": "<element_id>"
},
"name": "export_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output file format. | STEP |
| filename | No | File name without directory (default: the element ID). Saved under the server's output directory. | |
| part_ids | No | Export only these parts (Part Studios only). Default: everything. | |
| element_id | Yes | Element (tab) ID: the string after /e/ in the Onshape URL. Get it from get_document. | |
| document_id | Yes | Onshape document ID: the 24-character hex string after /documents/ in the document URL. Get it from list_documents. | |
| workspace_id | No | Workspace ID (the string after /w/ in the URL). Optional - defaults to the document's main workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||