Assembly Builder
#
assemblyBuilderAPIProvides functions for interaction with the classcad assembly builder api.
#
addAssemblyNodeDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
parentId | ObjectID | ||
name | string |
Returns Promise<void>
#
addAssemblyNodeWithIdentDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
parentIdent | string | ||
nodeIdent | string | ||
name | string |
Returns Promise<void>
#
addNodesDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
nodes | NodeParam[] |
Returns Promise<number[]>
#
addProductReferenceDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
productId | ObjectID | ||
parentId | ObjectID | ||
transformation | any |
Returns Promise<void>
#
addProductReferenceWithIdentDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
productIdent | string | ||
nodeIdent | string | ||
parentIdent | string | ||
transformation | any |
Returns Promise<void>
#
convertToTemplateDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
name | string |
Returns Promise<void>
#
create3DConstraintCreates new 3D constraint in the assembly
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
assemblyId | ObjectID | ||
cctype | string | ||
name | string |
Returns Promise<number>
The id of the new created constraint or null.
#
createRootAssemblyCreates a new rootAssembly.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
name? | string | 'AssemblyRoot' | The name for the rootAssembly, is optional, default is 'Assembly'. |
Returns Promise<number>
#
createAssemblyAsTemplateCreates a new assembly.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
name? | string | 'Assembly' | The name for the assembly, is optional, default is 'Assembly'. |
Returns Promise<number>
#
createPartAsTemplateCreates a new part and puts it in the part container. This part can be used to build assemblies.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
name? | string | 'Part' | The name for the assembly part, is optional, default is 'Part'. |
Returns Promise<number>
#
createRootAssemblyWithIdentDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
name | string | ||
ident | string |
Returns Promise<void>
#
exportNodeExports the given node and its potential subtree in case of it is an assembly. The node will be converted to a CC_AssemblyRoot. All used products with its containers will be exported as well.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
nodeOrProdId | ObjectID | Node in expanded tree or product to export | |
type? | 'ofb' l 'stp' l 'step' l 'stl' | 'ofb' | Type of file: either 'ofb', 'stp' or 'stl' |
Returns Promise<Uint8Array | null>
#
getAssemblyFromContainerReturns the assembly with given name from assembly container. If asmName is empty, all assemblies from assembly container will be returned.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
asmName | string l null | Name of assembly to look for |
Returns Promise<number | number[]>
#
getAssemblyNodeReturns the node with given name of given reference with specified name. If nodeName is empty, all nodes from the given reference will be returned.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
refId | ObjectID | Product reference to look for children of it | |
nodeName | string l null | Name of the child to look for |
Returns Promise<number | number[]>
#
getPartFromContainerReturns the part with given name from part container. If partName is empty, all parts from part container will be returned.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
partName | string l null | Name of part to look for |
Returns Promise<number | number[]>
#
getWorkCoordSystemReturns all wcs ids of refId with wcsName, if wcsName is empty all wcs ids will be returned.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
refId | ObjectID | Product reference to look for wcs in its children | |
wcsName | string l null | Name of the wcs to look for |
Returns Promise<number | number[]>
#
getConstraintReturns constraint information about the constraint with name constrName
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
refId | ObjectID | Prodcut reference to look for the constraint | |
constrName? | string | Optional name for the constraint to look for |
Returns Promise<any>
#
loadProductLoads 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 'step' l 'stl'. | |
name? | string | An optional name for data to load (for example filename). Has just logging purpose. |
Returns Promise<number[]>
#
loadProductFromUrlLoads a product from the given URL. Caller is responsible the identical product is not used already.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
url | string | The url. | |
filetype | 'ofb' l 'stp' l 'step' l 'stl' | The file type. |
Returns Promise<number[]>
The ids of the loaded products.
#
removeNodesDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
nodes | { referenceId: ObjectID; ownerId: ObjectID }[] |
Returns Promise<void>
#
removeProductReferenceDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
referenceId | ObjectID |
Returns Promise<void>
#
removeProductReferenceWithIdentDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
referenceIdent | string |
Returns Promise<void>
#
setCurrentNodeDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
referenceId | ObjectID |
Returns Promise<void>
#
setCurrentProductByIdentDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
ident | string |
Returns Promise<void>
#
setIdentForNodeOrProductDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
ident | string | ||
objId | ObjectID |
Returns Promise<void>
#
setNodeTransformationDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
referenceId | ObjectID | ||
ownerId | ObjectID | ||
transformation | any |
Returns Promise<void>
#
update3DConstraintValuesUpdates multiple constraint's specified (with 'paramName') limited value
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
constraintValues | ConstraintValueParam[] |
Returns Promise<void>
#
updateCylindricalConstraintsUpdates multiple Cylindrical 3D constraints
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
constraints | CylindricalConstraint[] |
Returns Promise<void>
#
updateFastenedConstraintsUpdates multiple Fastened 3D constraints
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
constraints | FastenedConstraint[] |
Returns Promise<void>
#
updateFastenedOriginConstraintsUpdates multiple Fastened Origin 3D constraints
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
constraints | FastenedOriginConstraint[] |
Returns Promise<void>
#
updateParallelConstraintsUpdates multiple Parallel 3D constraints
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
constraints | ParallelConstraint[] |
Returns Promise<void>
#
updatePlanarConstraintsUpdates multiple Planar 3D constraints
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
constraints | PlanarConstraint[] |
Returns Promise<void>
#
updateRevoluteConstraintsUpdates multiple Revolute 3D constraints
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
constraints | RevoluteConstraint[] |
Returns Promise<void>
#
updateSliderConstraintsUpdates multiple Slider 3D constraints
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
constraints | SliderConstraint[] |
Returns Promise<void>