Common
#
commonAPIProvides functions for interaction with the classcad common api.
#
clearClears the complete drawing.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. |
Returns Promise<void>
#
evaluateExpressionEvaluates an expression.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
objId | ObjectID | ||
expr | string | Expression string to be evaluated. |
Returns Promise<string | number | PointMemValue | (string | number | PointMemValue)[]>
#
getFacetingParametersGets the faceting parameters used to tessellate surfaces and curves.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. |
Returns Promise<[number, number]>
A JSON structure containing the faceting parameters: [angleToleranceInDegrees, ChordHeightTolerance].
#
setColorSets the r,g,b values of a product.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
productIds | ObjectID[] | The array with ids of the products to change color. | |
r | number | The red value (0...255). | |
g | number | The green value (0...255). | |
b | number | The blue value (0...255). |
Returns Promise<void>
#
setFacetingParametersSets the faceting parameters of current drawing
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
distanceTol | number | Distance tolerance between geometrical arc and tesselated arc | |
angleTol | number | Angle tolerance between two surfaces of tesselation |
Returns Promise<void>
#
setTransparencySets the transparency of a product.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
productIds | ObjectID[] | The array with ids of the products to change color. | |
transparency | number | Number value from 0 to 1. |
Returns Promise<void>
#
setObjectCoordSystemCalls "SetObjectCoordSystem" on object or sets object coord system if function does not exist.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
id | ObjectID | ||
origin | PointMemValue | ||
xVec | PointMemValue | ||
yVec | PointMemValue |
Returns Promise<void>
#
setObjectNameCalls "SetObjectName" on object or sets object name if function does not exist.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
id | ObjectID | ||
name | string |
Returns Promise<void>
#
updateDimensionPositionUpdates position of dimension text.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
dimensionId | ObjectID | ||
point | PointMemValue |
Returns Promise<void>