Skip to main content

copy()

[2D] Creates linear copies along an axis inside a sketch.

Returns: Copy

tip

See the guide for detailed usage examples.

Signatures​

copy(type: "linear", axis: AxisLike, options: LinearCopyOptions, ...objects: SceneObject[]): Copy

[2D] Creates linear copies along an axis inside a sketch.

ParameterTypeDescription
type"linear"Must be 'linear'
axisAxisLikeThe axis to copy along — xAxis() / yAxis() for the sketch's own axes, a sketched line via axis(l); a bare 'x' is the WORLD axis
optionsLinearCopyOptionsCopy count, spacing, etc.
...objectsSceneObject[]The objects to copy (defaults to last object) (optional)

copy(type: "linear", axis: AxisLike[], options: LinearCopyOptions, ...objects: SceneObject[]): Copy

[2D] Creates linear copies along multiple axes inside a sketch.

ParameterTypeDescription
type"linear"Must be 'linear'
axisAxisLike[]The axes to copy along — xAxis() / yAxis() for the sketch's own axes, a sketched line via axis(l); a bare 'x' is the WORLD axis
optionsLinearCopyOptionsCopy count, spacing, etc.
...objectsSceneObject[]The objects to copy (defaults to last object) (optional)

copy(type: "linear", axis: AxisLike | Connector, options: LinearCopyOptions, ...objects: SceneObject[]): Copy

[3D] Creates linear copies along an axis. A connector among the objects is copied as a frame: its copies are bolt.instance(1), … (see IConnector.instance), made inside the connector's own part body. At an assembly file's top level it copies assembly connectors only: copy('linear', 'x', { count: 4, offset: 50 }, bay) makes bay.instance(1) … bay.instance(3), the axis a world axis or an assembly connector.

ParameterTypeDescription
type"linear"Must be 'linear'
axisAxisLike | ConnectorThe axis to copy along — a world axis, an axis(), an edge, or a connector (its Z axis)
optionsLinearCopyOptionsCopy count, spacing, etc.
...objectsSceneObject[]The objects to copy (defaults to last object) (optional)

copy(type: "linear", axis: (AxisLike | Connector)[], options: LinearCopyOptions, ...objects: SceneObject[]): Copy

[3D] Creates linear copies along multiple axes. A connector among the objects is copied as a frame, one copy per grid cell — see IConnector.instance for the numbering.

ParameterTypeDescription
type"linear"Must be 'linear'
axis(AxisLike | Connector)[]The axes to copy along — each a world axis, an axis(), an edge, or a connector (its Z axis)
optionsLinearCopyOptionsCopy count, spacing, etc.
...objectsSceneObject[]The objects to copy (defaults to last object) (optional)

copy(type: "circular", center: Point2DLike, options: CircularCopyOptions, ...objects: SceneObject[]): Copy

[2D] Creates circular copies around a center point inside a sketch.

ParameterTypeDescription
type"circular"Must be 'circular'
centerPoint2DLikeThe center point to copy around
optionsCircularCopyOptionsCopy count, angle, etc.
...objectsSceneObject[]The objects to copy (defaults to last object) (optional)

copy(type: "circular", axis: AxisLike | Connector, options: CircularCopyOptions, ...objects: SceneObject[]): Copy

[3D] Creates circular copies around an axis. A connector among the objects is copied as a frame: copy('circular', 'z', { count: 6, angle: 360 }, bolt) makes bolt.instance(1) … bolt.instance(5). At an assembly file's top level it copies assembly connectors only, around a world axis or an assembly connector's Z axis.

ParameterTypeDescription
type"circular"Must be 'circular'
axisAxisLike | ConnectorThe axis to copy around — a world axis, an axis(), an edge, or a connector (its Z axis through its origin)
optionsCircularCopyOptionsCopy count, angle, etc.
...objectsSceneObject[]The objects to copy (defaults to last object) (optional)

copy(pattern: Repeat, ...connectors: Connector[]): Copy

[3D] Copies connectors onto the instances of a linear or circular repeat(): each copy is the connector's frame moved the way the repeat moved that instance, so copy(holes, bolt) puts bolt.instance(k) on holes.instance(k) — the repeat's own slots, skipped ones included, and a partial arc spaced the repeat's way. Edit the repeat and the copies follow. Connectors only, inside the part body that declares both the repeat and the connectors; a mirror, rotate or matrix repeat is refused.

ParameterTypeDescription
patternRepeatThe linear or circular repeat() to follow
...connectorsConnector[]The connectors to copy (optional)