DrawingAPI¶
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)
- DrawingAPI
Methods
change Drawing
- changeDrawing(
drawingId: number,
properties: DrawingProperties,
): DrawingProperties Changes one or more properties of a Drawing with the specified id.
Parameters
- drawingId: number
The id of the Drawing.
- properties: DrawingProperties
The properties of the Drawing.
Returns DrawingProperties
An object with the changed properties.
- drawingId: number
create Drawing
- createDrawing(data: ViewerDrawingResult, properties?: DrawingProperties): number
Creates a new Drawing from the Output of the ViewerDrawingAPI.
Parameters
- data: ViewerDrawingResult
The data generated with the help of the ViewerDrawingAPI.
Optional
properties: DrawingPropertiesInitial properties of the created Drawing.
Returns number
The id of the newly created Drawing.
- data: ViewerDrawingResult
get Drawings
remove Drawing
- removeDrawing(drawingId: number, safe?: boolean): RemoveState
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.
Optional
safe: booleanPerforms a safe remove which interrupt the removal process if the Drawing is part of one or more Snapshots.
Returns RemoveState
- drawingId: number
request Drawing Data
- requestDrawingData(drawingId: number): Promise<DrawingData>
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.
- drawingId: number
The DrawingAPI provides basic functionalities to interact with 2D Drawings created with the help of the ViewerDrawingAPI.