evCreate API 5.7 Help

FitCameraTo Function

Pans and zooms the camera to make given parts of a 3D model currently edited in an active 3D editing session fully visible and fit the viewport.

FitCameraTo(parts?: [[[EvItem|canvas-envision-document-items.html#part-items]]][]): Promise<void>

Parameters

parts?: EvItem[]

An array of Part item objects, one or more part items of a 3D model currently edited in an active 3D editing session that should be fully visible and fit the viewport.

If this parameter is not given, the entire 3D model will become fully visible and fit the viewport.

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

Return value

Promise<void>

A Promise that, if fulfilled, resolves to void if the given part items have become fully visible and fit the viewport of the active 3D editing session.

Discussion

The function will throw an error if the 3D editing mode has not been activated.

24 April 2025