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 | The drawing id. | |
ids | ObjectID[] | Ids of the objects to delete |
Returns Promise<void>
#
getGeometryInformationReturns an array containing the center of gravity as a point and the volume as a number from the model. Depending on the input parameter the calculations were made on a single solid, a part, a subassembly, the whole model, ... E.g. the center of gravity of a root assembly, will be the sum of all solid's center of gravity over the whole assembly structure
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
id | ObjectID | Id of the part, assembly, instance or solid we want the information from |
Returns Promise<[PointMemValue, number] | null>
Array of two elements containing center of gravity and the volume
#
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. | |
options.ident? | ObjectIdent |
Returns Promise<number[]>
#
loadFromUrlLoads from the given url.
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. | |
options.ident? | ObjectIdent |
Returns Promise<number[]>
Returns the ids of the loaded products.
#
recalcRecalc / update of the whole drawing with all its objects
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. |
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>
#
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>
#
requestVisualisationOfEntitiesRequests the visualisation of the given cad entities
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
cadEntityIds | ObjectID[] | Ids of the cad entities to request visualisation from |
Returns Promise<void>
#
requestVisualisationOfObjectRequests the visualisation of the given entity (e.g. Solid, Sheet)
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
entityId | ObjectID | Id of the entity, to request visualisation of its cad entities |
Returns Promise<void>
#
saveGets the current 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 | The drawing id. | |
type? | 'ofb' l 'stp' l 'step' l 'stl' | 'ofb' | Optional type to define data format, by default 'ofb' |
Returns Promise<Uint8Array | null>
The data or null.
#
saveToUrlGets the current drawing as stream data 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.
#
setAppearanceSets the appearance of the given entities (solid, sheet, curve arrays) like color, transparency, chord height and angle tolerance
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
objectIds | ObjectID[] | The array with ids of the entities to change appearance. | |
appearance | AppearanceParam | The appearance to set on the given entities. |
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>
#
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>
#
setColorDEPRECATED use setAppearance() instead, setColor() will be removed in a future release.
Sets the r,g,b values of a solid and propagates the color to the entities of the following operations if necessary.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
solidIds | ObjectID[] | The array with ids of the solids 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>
#
setCurrentProductSets the given product as the current product
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
productId | number | Id of the product. |
Returns Promise<void>
#
setTransparencyDEPRECATED use setAppearance() instead, setTransparency() will be removed in a future release.
Sets the transparency of a solid and propagates the transparency to the entities of the following operations if necessary.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
solidIds | ObjectID[] | The array with ids of the solids to change transparency. | |
transparency | number | Number value from 0 to 1. |
Returns Promise<void>