Linear pattern
linear_patternRepeat parts, features, or faces in a straight line or two-direction grid to create rows of holes, ribs, or legs, with set counts and spacing.
Instructions
Repeat parts, features or faces in a straight line (a row of holes, ribs, legs); add
a second direction for a grid. distance is the spacing between neighbouring instances.
Pattern the FEATURE that makes one hole or rib (feature_ids) so the copies cut or merge as
it does. The default name shows count and spacing ('Linear pattern x4 @ 20 mm'). The
reply says what changed (parts, volume).
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>",
"count": "<count>",
"distance": "<distance>",
"direction": "<direction>"
},
"name": "linear_pattern"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| count | Yes | Number of instances INCLUDING the original (2 or more), or an Onshape expression such as '#spokes' so a variable or configuration can drive it. | |
| verify | No | Measure the Part Studio before and after (two extra requests) and report what changed: part count and total volume, plus a warning when nothing changed (Onshape can accept a feature that does nothing). Set false to save requests. | |
| count_2 | No | Second direction (a grid): number of rows. Needs direction_2 and distance_2 too. | |
| distance | Yes | Length: a number in the configured unit (see get_settings; mm by default), a string with a unit such as '2.5 in', or an Onshape expression such as '#width'. | |
| face_ids | No | Repeat these faces (IDs from get_body_details). Give exactly one of part_ids, feature_ids and face_ids. | |
| part_ids | No | Repeat these whole parts (IDs from list_parts). Give exactly one of part_ids, feature_ids and face_ids. | |
| direction | Yes | Direction of the row: 'x', 'y' or 'z' (the world axes), the ID of a straight edge, planar face or cylindrical face (from get_body_details; a face gives its normal), or 'sketch:<feature_id>' for the construction line of a sketch. | |
| operation | No | Only for part_ids: 'new' makes each copy a separate part (default); 'add' merges the copies into existing parts; 'remove' cuts with them; 'intersect' keeps the overlap. | new |
| distance_2 | No | Second direction: spacing between rows. | |
| element_id | Yes | Element (tab) ID: the string after /e/ in the Onshape URL. Get it from get_document. | |
| merge_with | No | Part IDs the copies merge with when operation is 'add', 'remove' or 'intersect' (default: every part they touch). | |
| direction_2 | No | Second direction, same forms as `direction`. | |
| document_id | Yes | Onshape document ID: the 24-character hex string after /documents/ in the document URL. Get it from list_documents. | |
| feature_ids | No | Repeat these features (feature_id of an extrude or other feature, e.g. one spoke of a wheel); each copy merges the way the feature does. Give exactly one of part_ids, feature_ids and face_ids. | |
| workspace_id | No | Workspace ID (the string after /w/ in the URL). Optional - defaults to the document's main workspace. | |
| opposite_direction | No | Go the other way. | |
| opposite_direction_2 | No | Second direction: go the other way. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||