create_linear_pattern
Creates a linear pattern of selected features along a specified edge direction. Requires an edge ID to determine orientation and a distance and count for spacing.
Instructions
Create a linear pattern of features. Requires a deterministic edge id whose direction the pattern will follow — Onshape has no implicit world-X axis usable here. Workflow: create a reference (a sketch line on any plane pointing the direction you want, or pick an existing body edge via list_entities), then pass its id as directionEdgeId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Pattern name | Linear pattern |
| count | No | Total number of instances | |
| distance | Yes | Distance between pattern instances. Bare numbers are mm; use "10 mm" / "0.5 in" for explicit units. | |
| elementId | Yes | Part Studio element ID | |
| documentId | Yes | Document ID | |
| featureIds | Yes | Feature IDs to pattern | |
| workspaceId | Yes | Workspace ID | |
| directionEdgeId | Yes | Deterministic id of an edge whose direction the pattern follows. Get from list_entities(kinds=['edges']) on an existing body, or from a sketch line you drew specifically as a reference. Required. |