linear_pattern
Create a linear pattern of features like holes or bosses along a straight line at uniform spacing for arrays in CAD models.
Instructions
Pattern (patrón lineal) features in a single straight line.
Repeats one or more existing features along a direction at fixed spacing — the autoparts default for hole rows, fin arrays, and bolt grids. Single-direction only in v1; the second-direction (rectangular grid) variant is deferred since junior designers rarely use it.
Args: feature_names: Names of features to pattern. Pass exact names from get_active_part_info — e.g. ["Cortar-Extruir1"] for a single hole, ["Cortar-Extruir1", "Saliente-Extruir2"] for a hole + boss pair. direction_reference: Name of the entity defining the pattern direction. Easiest source: an "Eje1" name returned by a prior create_reference_axis call. Also accepted: a linear edge name (e.g. "Arista<1>@Pieza1") or a sketch-line name. Names are locale-sensitive. spacing_mm: Distance between consecutive instances in mm. Must be positive. count: Total number of instances INCLUDING the original (must be ≥ 2). For 5 holes total, pass count=5 — the original feature counts as instance #1. reverse: Flip the pattern direction along the reference. Default (False) follows the SW-default direction; pass True if the pattern goes the wrong way.
Returns the new pattern Feature with name (e.g. "LPattern1"), type ("linear_pattern"), and dimensions (D1=spacing, Num=count).
Example — 5 holes spaced 15 mm apart along an existing axis: eje = create_reference_axis("Arista<1>@Pieza1") # use a long edge linear_pattern(["Cortar-Extruir1"], eje["name"], spacing_mm=15.0, count=5)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| reverse | No | ||
| spacing_mm | Yes | ||
| feature_names | Yes | ||
| direction_reference | Yes |