Base Modeler
#
baseModelerAPIProvides functions for interaction with the classcad base modeler api.
#
deleteObjectsDeletes a multiple objects from structure tree or operation sequence
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
ids | ObjectID[] |
Returns Promise<void>
#
loadLoads the given data.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
data | ArrayBuffer | The data of the file as ArrayBuffer. | |
type | 'ofb' l 'stp' l 'step' l 'stl' | The data type. The server needs the type of the data to determine which import needs to be used. Possible values: 'ofb' l 'stp' l 'stl'. | |
name? | string | An optional name for data to load (for example filename). Has just logging purpose. |
Returns Promise<number[]>
#
loadFromUrlGets the model stream from the given url and calls @see BaseModelerAPI.Load.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
url | string | The url to load data from. | |
filetype | 'ofb' l 'stp' | The type of data delivered by the url (ofb, stp). | |
doClearAndInitialiseBM | boolean | If TRUE the drawing is cleared before loading and BaseModeling is initialised if needed. |
Returns Promise<number[]>
Returns the ids of the loaded products.
#
saveGet the current the drawing as stream data.
Important notes about the ofb format:
- It contains binary geometry blocks.
- Do not try to convert it to text, the geometry blocks will get damaged!
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
type? | 'ofb' l 'stp' l 'step' l 'stl' | 'ofb' |
Returns Promise<Uint8Array | null>
The data or null.
#
saveToUrlCalls @see BaseModlerAPI.Save and POSTs the result to the given url.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
url | string | The url to POST the model to. | |
filetype | 'ofb' l 'stp' | The file type be saved ('ofb', 'stp'). |
Returns Promise<boolean>
TRUE if saving was successfull.
#
requestVisualisationOfObjectRequests the visualisation of the given object
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
solidId | ObjectID |
Returns Promise<void>
#
requestVisualisationOfEntitiesRequests the visualisation of the given entities
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
solidIds | ObjectID[] |
Returns Promise<void>
#
setCurrentProductDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
productId | number |
Returns Promise<void>
#
setBrepElementColorSets the r,g,b values of the provided brep element on the given solid.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
solidId | ObjectID | The solid (CC_Solid) the brep element belongs to. | |
brepElementId | GraphicID | The id of the brep element to change color. | |
r | number | The red value of new color (0...255) | |
g | number | The green value of new color (0...255) | |
b | number | RepElementId The id of the brep element to change color. |
Returns Promise<void>
#
removeBrepElementColorRemoves the color of the provided brep element on the given solid.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
solidId | ObjectID | The solid (CC_Solid) the brep element belongs to. | |
brepElementId | GraphicID | The id of the brep element to change color. |
Returns Promise<void>
#
setBrepElementLabelSets the label of the provided brep element on the given solid.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
solidId | ObjectID | The solid (CC_Solid) the brep element belongs to. | |
brepElementId | GraphicID | The id of the brep element to change color. | |
label | string | The label as string. |
Returns Promise<void>
#
removeBrepElementLabelRemoves the label of the provided brep element on the given solid.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
solidId | ObjectID | The solid (CC_Solid) the brep element belongs to. | |
brepElementId | GraphicID | The id of the brep element to change color. |
Returns Promise<void>
#
setColorSets the r,g,b values of a product and propagates the color to the entities of the following operations if necessary.
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>
#
setTransparencySets the transparency of a product and propagates the transparency to the entities of the following operations if necessary.
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>
#
recalcRecalc / update of the whole drawing with all its objects
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID |
Returns Promise<void>