evCreate API 5.7 Help

Create Function

Creates a new gadget item of a given gadget type with a given set of gadget configuration properties in an Envision document currently opened in the Canvas Envision Creator app.

Create( type: [[[EvGadgetType|evgadgettype-type-alias.html]]], configProperties: [[[EvGadgetConfigProperty|evgadgetconfigproperty-interface.html]]][], bounds?: [[[EvRect|evrect-interface.html]]], zOrder?: [[[EvObjectZOrder|evobjectzorder-interface.html]]] ): Promise<[[[EvItem|canvas-envision-document-items.html#object-items]]]>

Parameters

type: EvGadgetType

A string, the gadget type of a new gadget item.

configProperties: EvGadgetConfigProperty[]

An array of EvGadgetConfigProperty objects, the gadget configuration properties of the new gadget item.

bounds?: EvRect

An EvRect object, the position and size of the bounding box of the new gadget item.

The default value is the default dimensions of the given gadget type.

zOrder?: EvObjectZOrder

An EvObjectZOrder object that includes:

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

  • The position of the new gadget 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 gadget item successfully created in the current document.

04 April 2025