evCreate API 5.7 Help

SetPoints Function

Replaces all the vertices of a given polygon item from an Envision document currently opened in the Canvas Envision Creator app with given new vertices.

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 polygon item from the Envision document currently opened in the Canvas Envision Creator app whose vertices should be replaced with the given new vertices.

If a given object item is not a polygon, the function throws an error.

points: EvCoord2D[]

An array of EvCoord2D arrays, an array of 2D coordinates of points that define given new vertices that should replace all the existing vertices of the given polygon item.

For a closed polygon, the coordinates of the starting and ending points must be the same.

Points that define a closed polygon

Return value

Promise<void>

A Promise that, if fulfilled, resolves to void if the given new vertices have successfully replaced the existing ones of the given polygon item in the current document.

01 May 2025