Base API
baseAPI#
Basic ClassCAD API functions. All other API's are using this base functions.
callSafeAPI#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| drawingId | DrawingID | ||
| namespace | string | ||
| func | string | ||
| args | any[] | ||
| options? | APIOptions |
Returns Promise<ServerResponse>
callUnsafeAPI#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| drawingId | DrawingID | ||
| command | string |
Returns Promise<ServerResponse>
createCCDrawing#
Creates 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.
disconnectCCDrawing#
Disconnects 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>
reconnectCCDrawing#
Executes the following sequence:
- @see disconnectCCDrawing
- connectCCDrawing (internal function)
- @see baseModelerAPI.recalc
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| drawingId | DrawingID |
Returns Promise<void>
fetchTree#
Fetch the tree from the ClassCAD model.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| drawingId | DrawingID |
Returns Promise<void>
callMiddleware#
Declaration
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>
undo#
Undo 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>
redo#
Redo 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>