Warning

Nightly releases are generated automatically from the latest source code and are intended for experimental purposes only. These builds may contain incomplete or untested features, bugs, or security vulnerabilities, and as such, are not for production use. Users should be aware that nightly releases may cause unexpected behavior, data loss, or system instability. Use of these releases is at the user's own risk, and it is advised to have adequate backups before testing. The software is provided as is with no guarantees or support.

DrawingAPI

Interface DrawingAPI

The DrawingAPI provides basic functionalities to interact with 2D Drawings created with the help of the ViewerDrawingAPI.

interface DrawingAPI {
    changeDrawing(
        drawingId: number,
        properties: DrawingProperties,
    ): DrawingProperties;
    createDrawing(
        data: ViewerDrawingResult,
        properties?: DrawingProperties,
    ): number;
    getDrawings(): number[];
    removeDrawing(drawingId: number, safe?: boolean): RemoveState;
    requestDrawingData(drawingId: number): Promise<DrawingData>;
}

Hierarchy (View Summary)

Methods

  • Returns all available Drawing ids.

    Returns number[]

    An Array of all available Drawing ids.

  • Removes a Drawing with the specified id. If a Drawing is part of a Snapshot the removal will fail with the State RemoveState.REFERENCED_BY_SNAPSHOT

    Parameters

    • drawingId: number

      The id of the to be removed Drawing.

    • Optionalsafe: boolean

      Performs a safe remove which interrupt the removal process if the Drawing is part of one or more Snapshots.

    Returns RemoveState

  • Returns the DrawingData for the specified Drawing id.

    Parameters

    • drawingId: number

      The id of the Drawing from which the data is requested.

    Returns Promise<DrawingData>

    The requested Drawing data.