evCreate API 5.7 Help

SetSize Function

Updates the width and height of the bounding box of a given object item from an Envision document currently opened in the Canvas Envision Creator app.

SetSize( obj: [[[EvItem|canvas-envision-document-items.html#object-items]]], width: number, height: number, transformed?: boolean, refPoint?: [[[EvRefPoint|evrefpoint-enumeration.html]]], lockAspect?: boolean, scaleOutline?: boolean ): Promise<void>

Parameters

obj: EvItem

An Object item object, an object item from the Envision document currently opened in the Canvas Envision Creator app whose 2D dimensions should be updated.

width: number

A number, a new width of the given object item's bounding box in the length UoM global for the evCreate API.

height: number

A number, a new height of the given object item's bounding box in the length UoM global for the evCreate API.

transformed?: boolean

A Boolean, a switch to indicate whether to update the 2D dimensions of the transformed (true) or original (false) bounding box of the given object item.

The default value is false.

refPoint?: EvRefPoint

A member of the EvRefPoint enumeration, a reference point on the bounding box of the given object item from which the new dimensions should be set. The Canvas Envision Creator updates the width and height so that the position of the given reference point remains unchanged.

The default value is the top left corner: "top_left".

lockAspect?: boolean

A Boolean, a switch to indicate whether to keep (true) or not to keep (false) the existing aspect ratio of the given object item's bounding box when setting the new dimensions.

When the aspect ratio is locked, the Canvas Envision Creator does not change the aspect ratio between the new width and height of the given object item's bounding box. It ignores the given height and calculates the new height based on the given width and old aspect ratio.

The default value is false.

scaleOutline?: boolean

A Boolean, a switch to indicate whether to scale (true) or not to scale (false) the thickness of the given object item's outline relatively to the new dimensions.

The default value is false.

Return value

Promise<void>

A Promise that, if fulfilled, resolves to void if the width and height of the given object item's bounding box have been successfully updated.

27 March 2025