evCreate API 5.7 Help

RotateTo Function

Rotates the bounding box of a given object item from an Envision document currently opened in the Canvas Envision Creator app to a given angle around a pivot point given on the bounding box of this object item.

RotateTo(obj: [[[EvItem|canvas-envision-document-items.html#object-items]]], angle: number, pivot?: [[[EvPivotPoint|evpivotpoint-enumeration.html]]]): 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 bounding box should be rotated to the given angle around the given pivot point.

angle: number

A number, an angle in the angle unit of measure (UoM) global for the entire evCreate API to which the given object item's bounding box should be rotated. Positive numbers rotate it clockwise, and negative numbers rotate it counterclockwise.

pivot?: EvPivotPoint

A member of the EvPivotPoint enumeration, a pivot point on the bounding box of the given object item.

The default value for a new object item is "center".

The given pivot point is stored for the object item for future rotations of this object item. If no pivot point is given during the following rotations of the object item, the pivot point given for this object item in the past is used.

Return value

Promise<void>

A Promise that, if fulfilled, resolves to void if the given object item's bounding box has been successfully rotated.

Discussion

The given object item is rotated relative to its original position without rotations—the bounding box without transformations. If the object item has been already rotated and has a bounding box with a rotation transformation, that existing rotation is removed first, and then the object item is rotated to the new angle—a new bounding box with the given rotation transformation is created.

To learn the global angle UoM, use the GetCurrentOptions(): Promise<EvCreateApiOptions> function. To set it, use the ConfigureOptions(opt: EvCreateApiOptions): Promise<EvCreateApiOptions> function.

27 March 2025