evCreate API 5.7 Help

Create Function

Creates a new polygon item in an Envision document currently opened in the Canvas Envision Creator app.

Create( points: [[[EvCoord2D|evcoord2d-type-alias.html]]][], smooth: boolean, zOrder?: [[[EvObjectZOrder|evobjectzorder-interface.html]]] ): Promise<[[[EvItem|canvas-envision-document-items.html#object-items]]]>

Parameters

points: EvCoord2D[]

An array of EvCoord2D arrays, an array of 2D coordinates of points that define the vertices of the new polygon item.

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

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

smooth: boolean;

A Boolean, a switch to set the shape smoothness of the new polygon item:

  • false: sharp corners and straight edges.

  • true: rounded corners and curved edges.

The isSmooth controls whether a given polygon item object is drawn as a smooth curve (true) or with corners (false)
zOrder?: EvObjectZOrder

An EvObjectZOrder object that includes:

  • The layer item object of a layer in the current document where the new polygon item should be added. The default value is the current layer on the current page.

  • The position of the new polygon item in the stack of object items on the given layer. It is a zero-based index that is 0 for the topmost object item on the layer and increases by 1 for each following object item going down the stack. The default value is 0.

Return value

Promise<EvItem>

A Promise that, if fulfilled, resolves to an Object item object of the new polygon item successfully created in the current document.

01 May 2025