Feature
#
featureAPIProvides functions for interaction with the classcad feature api.
#
closeFeatureMoves GhostRollbackBar back to RollbackBar, sets relevant solids' visibility.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
featureId | ObjectID | The id of the feature to close. |
Returns Promise<void>
#
createBooleanOperationCreates new BooleanOperation in part and sets entities for the operation
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
partId | ObjectID | ||
type? | BooleanOperationType | BooleanOperationType.UNION | |
entities? | ObjectID[] l null | null |
Returns Promise<number>
The id of the new created operation or null.
#
createExtrusionCreates new extrusion feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
partId | ObjectID |
Returns Promise<number>
The id of the new created operation or null.
#
createFeatureCreates a new (empty) Feature in part.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
partId | ObjectID | ||
type | string | ||
name | string |
Returns Promise<number>
The id of the new created Feature or null.
#
createWorkGeometryCreates new (default) WorkGeometry in a part
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
partId | ObjectID | Id of the product to which the new work geometry is added | |
type | string | Class of work geometry as string which will be created | |
name | string | Name of the created work geometry object |
Returns Promise<number>
The id of the new created WorkGeometry or null.
#
createNamedCoordSystemCreates new NamedCoordSystem in product and sets its coordinate system.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
productId | ObjectID | ||
name? | string | 'CoordSystem' | |
origin? | PointMemValue | { x: 0, y: 0, z: 0 } | |
xVec? | PointMemValue | { x: 1, y: 0, z: 0 } | |
yVec? | PointMemValue | { x: 0, y: 1, z: 0 } |
Returns Promise<number>
The id of the new created NamedCoordSystem or null.
#
createNamedPointCreates new NamedPoint in product and sets its position.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
productId | ObjectID | ||
name? | string | 'Point' | |
origin? | PointMemValue | { x: 0, y: 0, z: 0 } |
Returns Promise<number>
The id of the new created NamedPoint or null.
#
createRevolveCreates new Revolve feature
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
partId | ObjectID |
Returns Promise<number>
The id of the new created Revolve or null.
#
deleteFeatureDeletes feature object and its reference in operation sequence.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
id | ObjectID |
Returns Promise<void>
#
deleteDimensionsDeletes dimensions
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
ids | ObjectID[] |
Returns Promise<void>
#
getFeatureByNameReturns the id of the feature with name = featureName which is located in solid set.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
productId | ObjectID | Product (part) to look for the feature in its solid set | |
featureName | string l null | Name of the feature to look for |
Returns Promise<number>
#
linkWithExpressionConnects expression in ExpressionSet with dimensional constraints in sketcher or parameter in feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
objectId | ObjectID | Id of dimension or feature object | |
expressionName | string | Expression name | |
parameterName | string | Parameter in feature which will be connected to expression |
Returns Promise<void>
#
newPartClears the drawing and creates a new part
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
name | string | Name of the new part |
Returns Promise<number>
#
openFeatureMoves GhostRollbackBar to the position before passed feature, sets relevant solids' visibility.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID |
Returns Promise<void>
#
operationMoveBeforeMoves RollbackBar to the position before passed feature (backwards or forwards), sets relevant solids' visibility, if OperationSequence.isDirty = TRUE and forwards(to end direction) then OperationSequence.GenerateSequence ("Recalc") will be called
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
partId | ObjectID | ||
featureId | ObjectID |
Returns Promise<void>
#
operationMoveToEndMoves RollbackBar to the end of OperationSequence and sets relevant solids' visibility, if OperationSequence.isDirty = TRUE then OperationSequence.GenerateSequence ("Recalc") will be called
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
partId | ObjectID |
Returns Promise<void>
#
pickDeclaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
partId | ObjectID | ||
type | string | ||
points | PointMemValue[] |
Returns Promise<number[]>
#
unlinkExpressionUnlinks expression from dimensional constraints in sketcher or parameter in feature
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
objectId | ObjectID | ||
parameterName | string |
Returns Promise<void>
#
updateBooleanOperationSets entities on BooleanOperation This method can be used to complete the boolean operation, if CreateBooleanOperation was used to only create the operation without passing entities or to change the operation entities when editing operation.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
operationId | ObjectID | ||
type | BooleanOperationType | ||
entities | ObjectID[] |
Returns Promise<void>
#
updateBoxUpdates box feature
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID | ||
references | ObjectID[] | ||
width | APIParam<number> | ||
length | APIParam<number> | ||
height | APIParam<number> |
Returns Promise<void>
#
updateChamferUpdates Chamfers - sets parameters, handles references
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID | ||
type | ChamferType | ||
references | GraphicID[] | ||
distance1 | APIParam<number> | ||
distance2 | APIParam<number> | ||
angle | APIParam<number> |
Returns Promise<void>
#
updateConeUpdates cone feature
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID | ||
references | ObjectID[] | ||
bDiameter | APIParam<number> | ||
tDiameter | APIParam<number> | ||
height | APIParam<number> |
Returns Promise<void>
#
updateCylinderUpdates cylinder feature
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID | ||
references | ObjectID[] | ||
diameter | APIParam<number> | ||
height | APIParam<number> |
Returns Promise<void>
#
updateExpressionsUpdates the expressions of multiple parts Expression objects with name names[i] will be updated with expressions[i] formula. Thus their length should match! Expression objects with name toDeleteList[j] will be deleted.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
expressions | ExpressionParam[] |
Returns Promise<void>
#
updateExtrusionUpdates extrusion feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID | ||
selectedIds | ObjectID[] | ||
type | ExtrusionType | ||
limit1 | APIParam<number> | ||
limit2 | APIParam<number> | ||
taperAngle | APIParam<number> | ||
direction | APIParam<PointMemValue> | ||
capEnds | 0 l 1 |
Returns Promise<void>
#
updateImportUpdates Import - Removes old solids, sets new imported ones, and renames the feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
featureId | ObjectID | Id of the import feature | |
stream | any | Geometry stream | |
fileFormat | 'stp' l 'step' | Supported file formats are: 'stp', 'step' | |
fileName | string |
Returns Promise<void>
#
updateFilletUpdates Fillets - sets parameters, handles references.
A reference can be either a classcad object of type CC_Brepreference or the BrepId (edgeId, faceId, etc) of such an object.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID | ||
references | GraphicID[] | ||
radius | APIParam<number> |
Returns Promise<void>
#
updatePatternUpdates pattern feature - sets parameters, handles references, does recalc.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
operationId | ObjectID | Id of the operation | |
solidObjectsToPattern | ObjectID[] | Solid objects for the operation | |
references | GraphicID[] | Selected vertices or points for the 1st direction | |
params | [0 l 1, APIParam<number>, APIParam<number>, 0 l 1] | [inverted, distanceOrAngle, count, merged], where inverted - 0 or 1 - determines the 1st direction of the pattern; distanceOrAngle - distance (LinearPattern) or angle (CircularPattern) between consecutive copied elements over the 1st direction; count - number of copies over the 1st direction (including the original element); merged - 0 or 1 - determines whether the copies will be merged into a single solid (1) or separate solids (0) | |
references2 | GraphicID[] l null | Selected vertices or points for the 2nd direction (optional for LinearPattern) | |
params2 | [0 l 1, APIParam<number>, APIParam<number>] l null | [inverted2, distance2, count2] (optional for LinearPattern), where inverted2 - 0 or 1 - determines the 2nd direction of the pattern; distance2 - distance between consecutive copied elements over the 2nd direction; count2 - number of copies over the 2nd direction (including the original element); |
Returns Promise<void>
#
updateMirrorUpdates mirror feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
featureId | ObjectID | Id of the mirror operation | |
solidObjectsToMirror | ObjectID[] | Ids of the solids to be mirrored | |
references | ObjectID[] | Ids of plane(s) or face(s) |
Returns Promise<void>
#
updateRevolveUpdates revolve feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
featureId | ObjectID | Id of the feature | |
selectedIds | ObjectID[] | Ids of curves | |
axisIds | ObjectID[] | Ids of the axis entities | |
angle1 | APIParam<number> | Revolve start angle | |
angle2 | APIParam<number> | Revolve end angle | |
inverted | 0 l 1 | 0 or 1 - determines the direction (clockwise / counterclockwise) of revolve |
Returns Promise<void>
#
updateSliceUpdates slice feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
featureId | ObjectID | Id of the operation | |
solidObjectsToSlice | ObjectID[] | Array of solid objects to be sliced | |
plane | ObjectID | Selected workplane | |
sideFlag | 0 l 1 | 0 or 1 - determines which side of the solid remains and which one is culled |
Returns Promise<void>
#
updateSliceBySheetUpdates slice by sheet feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
featureId | ObjectID | Id of the operation | |
solidToCut | ObjectID | Solid which will be cutted | |
sheet | ObjectID | Sheet to slice the solidToCut with | |
inverted | 0 l 1 | 0 or 1 - flag to toggle direction of sheet |
Returns Promise<void>
#
updateSphereUpdates sphere feature
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID | ||
references | ObjectID[] | ||
radius | APIParam<number> |
Returns Promise<void>
#
updateTransformationUpdates transformation feature.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | The drawing id. | |
featureId | ObjectID | Id of the transformation operation | |
solidObjectsToTransform | ObjectID[] | Id of the solids to be transformed | |
references | ObjectID[] | Ids of 2 points that define the transformation axis or 2 coordinate systems | |
inverted | 0 l 1 | 0 or 1 - determines the direction of transformation | |
distanceOrAngle | APIParam<number> | Translation distance or rotation angle |
Returns Promise<void>
#
updateWorkAxisUpdates WorkAxis - sets parameters, handles references.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
workAxisId | ObjectID | ||
axisType | WorkAxisType | ||
references | GraphicID[] | ||
position | APIParam<PointMemValue> | ||
direction | APIParam<PointMemValue> | ||
local | boolean |
Returns Promise<void>
#
updateWorkCoordSystemUpdates WorkCoordSystem - sets parameters, handles references.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
workCoordSystemId | ObjectID | ||
coordSystemType | WorkCoordSystemType | ||
references | GraphicID[] | ||
coordinateSystem | PointMemValue[] | ||
offset | APIParam<PointMemValue> | ||
rotation | APIParam<PointMemValue> | ||
inverted | 0 l 1 | ||
local | boolean |
Returns Promise<void>
#
updateWorkPlaneUpdates WorkPlane - sets parameters, handles references.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
workPlaneId | ObjectID | ||
planeType | WorkPlaneType | ||
references | GraphicID[] | ||
offset | APIParam<number> | ||
angle | APIParam<number> | ||
position | APIParam<PointMemValue> | ||
normal | APIParam<PointMemValue> | ||
local | boolean |
Returns Promise<void>
#
updateWorkPointUpdates WorkPoint - sets parameters, handles references.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
workPointId | ObjectID | ||
pointType | WorkPointType | ||
references | GraphicID[] | ||
position | APIParam<PointMemValue> | ||
local | boolean |
Returns Promise<void>
#
rollback#
moveToEndMoves the rollback bar to the end of the feature list.
Calls
- Feature.OperationMoveToEnd
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID |
Returns Promise<void>
#
moveBeforeMoves the rollback bar before the given feature.
Calls
- Feature.OperationMoveBefore
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
drawingId | DrawingID | ||
featureId | ObjectID |
Returns Promise<void>
#
calculateMovementCalculates the feature id according on the new and the old index of the rollback bar.
Declaration
Params
Name | Type | Default | Description |
---|---|---|---|
oldIndex | number | The old rollback bar index. | |
newIndex | number | The new rollback bar index. | |
featureIds | ObjectID[] | The feature id list. | |
offset? | number | 4 | The number of features at the top of the list that should not be considered by the rollback bar. |
Returns { moveTo: 'end' | 'before'; featureId: ObjectID; index: number }
An object in the form { moveTo: 'end' | 'before'; featureId: ObjectId, index: number }.
If moveTo is equal to 'end', the end of the list is reached and the featureId will be -1.