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.


Did you find this page useful? Please give it a rating:
Thank you for rating this page!
Any issues or feedback?
What kind of problem would you like to report?
Please tell us more about what's wrong: