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
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.