evCreate API 5.7 Help

SetPoints Function

Replaces all the segments of a given Bézier curve item from an Envision document currently opened in the Canvas Envision Creator app with given new segments.

SetPoints(obj: [[[EvItem|canvas-envision-document-items.html#object-items]]], points: [[[EvCoord2D|evcoord2d-type-alias.html]]][]): Promise<void>

Parameters

obj: EvItem

An Object item object, a Bézier curve item from the Envision document currently opened in the Canvas Envision Creator app whose segments should be replaced.

If a given object item is not a Bézier curve, the function throws an error.

points: EvCoord2D[]

An array of EvCoord2D arrays, an array of 2D coordinates of points that define one or more new segments of the given Bézier curve item.

Bezier curve example with 7 segments and 28 points

Each segment of a Bézier curve is defined by four points specified in the following order:

  • Starting point

  • Weight point 1

  • Weight point 2

  • Endpoint

A weight point defines how far the segment is pulled in its direction.

If the Bézier curve includes multiple segments, the following rules must be met:

  • The total number of the points must be divisible by 4.

  • The coordinates must be the same for:

    • The endpoint of a given segment.

    • The starting point of the segment following the given segment.

Return value

Promise<void>

A Promise that, if fulfilled, resolves to void if the given new segments have successfully replaced the existing old segments of the given Bézier curve.

01 May 2025