Base API
#
baseAPIBasic ClassCAD API functions. All other API's are using this base functions.
#
callSafeAPIDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
namespace | string | ||
func | string | ||
args | any[] | ||
options? | APIOptions |
Returns Promise<ServerResponse>
#
callUnsafeAPIDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
command | string |
Returns Promise<ServerResponse>
#
createCCDrawingCreates a new drawing and its Socket client and connects it to the server.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingName? | string | ||
client? | AwvNodeClient |
Returns Promise<DrawingID | null>
The id of the new drawing.
#
disconnectCCDrawingDisconnects the drawing from ClassCAD and resets the drawing.
It does not remove the Socket client!
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID |
Returns Promise<void>
#
reconnectCCDrawingExecutes the following sequence:
- @see disconnectCCDrawing
- connectCCDrawing (internal function)
- @see baseModelerAPI.recalc
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID |
Returns Promise<void>
#
fetchTreeFetch the tree from the ClassCAD model.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID |
Returns Promise<void>
#
callMiddlewareDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
middlewareCommand | string | The custom middleware command to call. | |
data | any | Arbitrary data to be used by the server middleware. |
Returns Promise<ServerResponse>
#
undoUndo the last operation or if state isn't empty, load the state with name = state.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
state? | string |
Returns Promise<void>
#
redoRedo the last undo or if state isn't empty, load the state with name = state.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
state? | string |
Returns Promise<void>