ViewerDrawingAPI

Interface ViewerDrawingAPI

The ViewerDrawingAPI provides basic functionalities to control the 2D drawing mode and the processed output.

See the ViewerDrawingProcessOptions for the various configuration options for creating a drawing.

const ctx = webvis.getContext();
const viewer = ctx.getViewer();
// Create a new 2D drawing by entering the drawing mode, interacting with the viewer and finally leaving the drawing mode:
viewer.enterDrawingMode(); // after that you can draw on top of your 3D model
viewer.leaveDrawingMode(); // leaves the 2D drawing mode by committing the drawings and returns the processed 2D drawing data

// You can also cancel any started drawing:
viewer.enterDrawingMode();
viewer.cancelDrawingMode(); // leaves the 2D drawing mode and discards all uncomitted drawings

interface ViewerDrawingAPI {
    cancelDrawingMode(): void;
    enterDrawingMode(): void;
    leaveDrawingMode(
        options?: ViewerDrawingProcessOptions,
    ): Promise<ViewerDrawingResult>;
}

Hierarchy (View Summary)

Methods

  • Leaves the 2D drawing mode and discards all uncomitted drawings.

    Returns void

  • Enters the 2D drawing mode where you can draw on top of your 3D model.

    Returns void




Was this page helpful? Please leave a thumbs up or down.