Skip to main content

Sketch

create(param)

Creates a new sketch and places it optionally on a face or work plane

  • if planeId is a face, a new work plane on that face will be created
  • if planeId is a workplane, the sketch will directly placed on it

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID // id of the new sketch
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the part to create the sketch on
[param.planeId]string | real | idid of the face or work plane to place the sketch on

Example

res = api.v1.sketch.create({ id: 4 })
res = api.v1.sketch.create({ id: 4, planeId: 15 })

setWorkPlane(param)

Sets workplane for the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to set workplane for
param.planeIdstring | real | idid of the work plane to set the sketch on

Example

res = api.v1.sketch.setWorkPlane({ id: 4, planeId: 15 })

constraint(param)

Creates one or multiple constraints in the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID|Array<id|VOID> // id or ids of created constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobject | Array<object>object or objects containing all the parameters
param.idstring | real | idid of the sketch to create constraints in
[param.name]stringname of the constraint to create
param.type"COINCIDENT" | "COLINEAR" | "CONCENTRIC" | "EQUAL_LENGTH" | "EQUAL_RADIUS" | "FIXATION" | "HORIZONTAL" | "MIDPOINT" | "PARALLEL" | "PERPENDICULAR" | "SPLINE_FIT_POINT" | "SYMMETRY" | "TANGENT" | "VERTICAL"type of the constraint to create
param.geomIdsArray<(string|real|id)>sketch geometry like points, curves, ... which will be constrained

Example

res = api.v1.sketch.constraint({ id: 796, type: 'HORIZONTAL', geomIds: [startPt, endPt] })
res = api.v1.sketch.constraint({ id: 796, type: 'VERTICAL', geomIds: [line3] })
res = api.v1.sketch.constraint({ id: 796, name: 'A', type: 'COINCIDENT', geomIds: [873, 875] })

dimension(param)

Creates one or multiple dimensional constraints in the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID|Array<id|VOID> // id or ids of created dimensional constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobject | Array<object>object or objects containing all the parameters
param.idstring | real | idid of the sketch to create dimensional constraints in
[param.name]stringname of the constraint to create
param.type"RADIUS" | "DIAMETER" | "OFFSET" | "HORIZONTAL_DISTANCE" | "VERTICAL_DISTANCE" | "ANGLE" | "ANGLEOX"type of the constraint to create
[param.value]real | expressionvalue or expression to set for this dimensional constraint. If empty, value will be calculated automatically
param.geomIdsArray<(string|real|id)>sketch geometry like points, curves, ... which will be constrained
[param.dimPos]pointposition of the dimension text, in case of type is "ANGLE", it also can be used to define which sector to be constrained
[param.reflex]booleanFALSEIf true, the angle will be the reflex angle in case of type is "ANGLE", which is bigger than 180deg, actually the outside angle (default=FALSE)

Example

res = api.v1.sketch.dimension({ id: sketch, type: 'ANGLE', geomIds: [873, 875], dimPos: [45, 80, 0], value: '60g' })
res = api.v1.sketch.dimension({ id: sketch, type: 'OFFSET', geomIds: [res.startId, res.endId] })

sketchRegion(param)

Creates a sketch region for a given sketch from sketch geometry

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id // id of the created sketch region
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create the sketch region
[param.name]stringname of the sketch region
param.geomIdsArray<(string|real|id)>sketch geometry that the new sketch region will consist of, all should belong to the given sketch

Example

res = api.v1.sketch.sketchRegion({ id: 796, geomIds: [852, 863, 895, 912] })

changeReferenceGeometry(param)

Re-links "Use"-Geometry in sketch - the same geometry will be connected to another reference

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch which the geometry belongs to
param.geomIdstring | real | idid of the sketch geometry that should be relinked
param.refIdstring | real | idid of the new brep element to be referenced, like edge or vertex

Example

res = api.v1.sketch.changeReferenceGeometry({ id: 12, geomId: 56, refId: 85 })

circularPattern(param)

Patterns a rigidset (or single object) in circular arrange/order

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: {
constraint: id,
dimension: id|VOID,
geometry: Array<id>
}
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create circular pattern in
param.rigidSetIdstring | real | idid of the rigid set to pattern
param.centerIdstring | real | idid of the point to be used as an origin for rotation
param.anglerealangular offset in radians between neighbouring patterned objects around rotation center
param.countrealnumber of copies

Example

res = api.v1.sketch.circularPattern({ id: 42, rigidSetId: 60, centerId: 61, angle: 90g, count: 4 })

mirrorPattern(param)

Patterns a rigidset (or single object) in mirror arrange/order

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: {
constraint: id,
geometry: Array<id>
}
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create mirror pattern in
param.rigidSetIdstring | real | idid of the rigid set to pattern
param.symmetryLineIdstring | real | idid of the line to be used as a symmetry line

Example

res = api.v1.sketch.mirrorPattern({ id: 42, rigidSetId: 60, symmetricLineId: 61 })

copyGeometry(param)

Copies sketch geometry

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id[]|VOID // ids of copied objects
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to copy object
param.geomIdsstring | real | idids of the sketch geometry to copy
param.translationpointoffset from initial objects as translation vector
[param.doCopyConstraints]booleanTRUEa flag allowing to restrict copying constraints from original selected objects (default=TRUE)

Example

res = api.v1.sketch.copyGeometry({ id: 6, geomIds: [25, 36, 47, 58], translation: [20, 30, 0] })

linearPattern(param)

Patterns a rigidset (or single object) in linear/rectangular arrange/order. Copy count number over at least one dimension should be specified.

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: {
constraint: id,
dimensions: Array<id|VOID>,
geometry: Array<id>
}
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create linear pattern in
param.rigidSetIdstring | real | idid of the rigid set to pattern
[param.xDistance]real0horizontal offset (x-axis) between neighbouring patterned objects (default=0)
[param.yDistance]real0vertical offset (y-axis) between neighbouring patterned objects (default=0)
[param.xCount]real1number of copies along the x-axis (default=1)
[param.yCount]real1number of copies along the y-axis (default=1)

Example

res = api.v1.sketch.linearPattern({ id: 42, rigidSetId: 60, xCount: 5, xDistance: 30 })
res = api.v1.sketch.linearPattern({ id: 42, rigidSetId: 60, xCount: 3, xDistance: 50, yCount: 3, yDistance: 100 })

copyFrom(param)

Copies the sketch geometry from one sketch to another

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the existing sketch to copy sketch geometry into it
param.toCopyIdstring | real | idid of the sketch to copy elements from

Example

res = api.v1.sketch.copyFrom({ id: 6, toCopyId: 25 })

fillet(param)

Creates a fillet in place of a point and its connecting two lines

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: Array<id>|VOID // a tuple of (arcId, controlPointId, startPointId, endPointId) or VOID if fillet couldn't be created
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create the fillet in
param.lineIdsArray<(string|real|id)>ids of the two lines to create the fillet at its connecting point
[param.offset]realoffset from the incidence point to fillet arc start / end. If neither param.offset or param.radius are set, param.offset is taken 1/4 length of the shortest of lines referred in param.lineIds
[param.radius]realradius of the fillet arc. Is ignored if param.offset is set

Example

res = api.v1.sketch.fillet({ id: 6, lineIds: [15, 18], offset: 10 })
res = api.v1.sketch.fillet({ id: 6, lineIds: [15, 18], radius: 8 })

rectangle(param)

Creates a rectangle formed by two positions

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: Array<id> // ids of the lines of the created rectangle
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}

result information:

  • index 0: horizontal line not connected to end position
  • index 1: vertical line connected to end position
  • index 2: horizontal line connected to end position
  • index 3: vertical line not connected to end position
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create the rectangle in
param.startPospointposition of the first point to form the rectangle
param.endPospointposition of the second point to form the rectangle
[param.isCentered]booleanFALSEa flag which defines if the rectangle is created as centered or not (default=FALSE)
[param.genFixation]booleanTRUEa flag which defines if fixation in the Origin should be autogenerated or not (default=TRUE)
[param.genIncidence]booleanTRUEa flag which defines if coincidence constraints between an existing point and the new rectangle corner should be autogenerated or not (default=TRUE)
[param.genTangency]booleanTRUEa flag which defines if tangency constraints between an existing arc and new rectangle should be autogenerated or not (default=TRUE)

Example

res = api.v1.sketch.rectangle({ id: 6, startPos: [0, 0, 0], endPos: [20, 20, 0], isCentered: TRUE })

referenceGeometry(param)

Creates new "Use"-Geometry in sketch. The sketch geometry will be created at the given brep elements and projected into sketch plane. It also creates a reference to the given brep element.

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create the reference geometry in
param.brepIdsstring | real | idids of the brep elements to create sketch geometry at and reference on

Example

res = api.v1.sketch.referenceGeometry({ id: 6, brepIds: [256, 258, 236] })

rigidSet(param)

Creates a rigid set from given sketch geometry in the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID // id of the created rigid set
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create the rigid set in
param.geomIdsArray<(string|real|id)>ids of sketch geometry to create the rigid set from

Example

res = api.v1.sketch.rigidSet({ id: 6, geomIds: [25, 28, 31, 33] })

undoFillet(param)

Deletes an existing fillet by removing the arc and its constraints and connect lines again

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to delete the fillet in
param.arcIdstring | real | idid of the fillet-made arc to delete

Example

res = api.v1.sketch.undoFillet({ id: 6, arcId: 89 })

generateAutoConstraints(param)

Automatically generates constraints whenever it makes sense and doesn't add up redundancy

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to generat auto constraints
param.geomIdstring | real | idid of the sketch geometry to auto constraint or the sketch id itself to autoconstraint each of sketch's objects
[param.genFixation]booleanTRUEa flag which defines if fixation in the Origin should be autogenerated or not (default=TRUE)
[param.genIncidence]booleanTRUEa flag which defines if coincidence constraints between an existing point and the new rectangle corner should be autogenerated or not (default=TRUE)
[param.genTangency]booleanTRUEa flag which defines if tangency constraints between an existing arc and new rectangle should be autogenerated or not (default=TRUE)
[param.genVertAndHoriz]booleanTRUEa flag which defines if vertical and horizontal constraints should be autogenerated or not (default=TRUE)

Example

res = api.v1.sketch.generateAutoConstraints({ id: 6, geomId: 56 })

loadFrom(param)

Loads an ofb file by filename, data or url and copies the sketch geometry from loaded sketch to the existing sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to copy sketch elements into it
param.partIdstring | real | idid of the part to load the sketch into
[param.url]stringurl to loading ofb file, where the sketch want be loaded from
[param.file]stringfull path of the file. Path has to be a for the ClassCAD process reachable local or UNC path.
[param.data]stringdata/content of the model to load sketch from
[param.encoding]"base64"the encoding the data is encoded with. If compression is also set, the decoding happens first!
[param.compression]"deflate"the compression algorithm the data is compressed with.
[param.format]"OFB""OFB"content format of to load file, where the sketch want to be loaded from (default="OFB")
[param.name]stringname of the sketch in the loaded ofb file, if no name is given, the first found sketch will be chosen

Example

res = api.v1.sketch.loadFrom({ id: 6, partId: 69, url: 'https://.../file.ofb', format: 'ofb' })
res = api.v1.sketch.loadFrom({ id: 6, partId: 69, file: '/var/models/file.ofb' })
res = api.v1.sketch.loadFrom({ id: 6, partId: 69, data: 'xx124b', format: 'ofb' })

moveGeometry(param)

Moves the given sketch geometry by translation vector

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: boolean // true if sketch state is still solved
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to move sketch geometry in
param.geomIdsArray<(string|real|id)>ids of the sketch geometry to move by translation vector
param.translationpointtranslation vector to move sketch geometry

Example

res = api.v1.sketch.moveGeometry({ id: 6, geomIds: [45, 58], translation: [20, 85, 0] })

setReferences(param)

Creates and sets the plane, axis and origin reference of the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to set the references
[param.planeId]string | real | idid of a face or a workplane. This will be the plane where the sketch lies on.
[param.invertPlane]booleanFALSEif true, the normal of the plane will be inverted (default=FALSE)
[param.axisId]string | real | idid of a line or a workaxis.
[param.isXAxis]booleanTRUEif true, the axisId will be the x-axis of the sketch, else the x-Axis will be the crossvector of the normal and the axisId (default=TRUE)
[param.invertAxis]booleanFALSEif true, the direction of the axis will be inverted (default=FALSE)
[param.originId]string | real | idid of a point or vertex of the sketch's origin reference

Example

res = api.v1.sketch.setReferences({ id: 6, planeId: 58 })

splitAllCurves(param)

Splits all curves in the given sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: Array<id|VOID> // Array of trimmable curves
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to split all curves

Example

res = api.v1.sketch.splitAllCurves({ id: 6 })

splitCurves(param)

Splits curves in specified parameterized positions

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID|Array<Array<id|VOID>>
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}

result information:

  • VOID is returned if it isn't possible to split one or more specified entities.
  • Otherwise, an array of same length as param.splits is returned.
  • It contains arrays of ids of splitted curves in the same order as in param.splits.
  • If the length of param.splits[i] was N, then the length of result[i] will be N+1.
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to split curves
param.splitsArray<object>objects containing the split information
param.splits.geomIdstring | real | idid of curve to be split
param.split.valuesArray<real>split values for the curve to be split. values are in range of [0,1]. value represents position on the curve from its start to the end (or from 0 to 2*PI for circles)

Example

res = api.v1.sketch.splitCurves({ id: 6, splits: [{ geomId: 25, values: [0.236, 0.82345124] }] })

splitCurvesMergeBack(param)

Merges the splitted curves back

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to merge back splitted curves

Example

res = api.v1.sketch.splitCurvesMergeBack({ id: 6 })

unlinkReferenceGeometry(param)

Unlinks "Use"-Geometry in sketch - sketch geometry still exists, but it is not connected to reference anymore

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to unlink referenced sketch geometry
param.geomIdstring | real | idid of the sketch geometry to unlink

Example

res = api.v1.sketch.unlinkReferenceGeometry({ id: 6, geomId: 48 })

updateDimension(param)

Updates the dimension of sketch geometry and recalculates the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: boolean // true if sketch state is solved
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the dimension to update
param.valuereal | expressionthe new value or expression for the dimension

Example

res = api.v1.sketch.updateDimension({ id: 256, value: 50 })
res = api.v1.sketch.updateDimension({ id: 256, value: '@expr.distance1' })

updateGeometry(param)

Updates the sketch geometry

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to update sketch geometry
[param.points]Array<object>array of points to create
param.points[].idpointid of the point to update
param.points[].pospointnew position of the point
[param.lines]Array<object>array of lines to create
param.lines[].idpointid of the line to update
param.lines[].startPospointnew start position of the line
param.lines[].endPospointnew end position of the line
[param.arcsBy3Points]Array<object>array of arcs to create by three given points
param.arcsBy3Points[].idpointid of the arc to update by 3 points
param.arcsBy3Points[].startPospointstart position of the arc
param.arcsBy3Points[].endPospointend position of the arc
param.arcsBy3Points[].midPospointmiddle position on the arc (not center)
[param.arcsByCenter]Array<object>array of arcs to create by start-, end- and center point
param.arcsByCenter[].idpointid of the arc to update by center
param.arcsByCenter[].startPospointstart position of the arc
param.arcsByCenter[].endPospointend position of the arc
param.arcsByCenter[].centerPospointcenter position of the arc
[param.arcsByCenter[].isClockwise]booleanTRUEflag to define whether the arc is clockwise from start- to end-point around center-point or not (default=TRUE)
[param.circles]Array<object>array of circles to create
param.circles[].idpointid of the circle to update
param.circles[].centerPospointcenter position of the circle
param.circles[].radiusrealradius of the circle

Example

res = api.v1.sketch.updateGeometry({ id: 6, points: [{ id: 25, pos: [10,50,0], { id: 29, pos: [10,60,0] }] })
res = api.v1.sketch.updateGeometry({ id: 6, circles: [{ id: 56, centerPos: [40,50,0], radius: 15 }] })

updateSketchRegion(param)

Updates sketch regions with new sketch geometry

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.regionsArray<object>array of objects containing update informaton for the region
param.regions.idstring | real | idid of the sketch region to update
param.regions.geomIdsArray<(string|real|id)>array or sketch geometry to update the region with

Example

res = api.v1.sketch.updateSketchRegion({ id: 79, regions: [{ id: 45, geomIds: [14, 78, 96] }] })

getPoints(param)

Get the specific point ids of lines, arcs or circles

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: { startId: string|real|id, endId: string|real|id } |
{ startId: string|real|id, endId: string|real|id, centerId: string|real|id } |
{ centerId: string|real|id } |
VOID // object containing the specific points, which define the geometry which has been provided
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}

result information:

  • if input is a line then it returns an object containing startId and endId of the line
  • if input is an arc then it returns an object containing startId, endId and centerId of the arc
  • if input is a circle then it returns an object containing centerId of the circle
ParamTypeDescription
paramobjectobject containing the parameters
param.idstring | real | idid of the geometry (e.g. line, arc, circle) to get the specific point ids from

Example

res = api.v1.sketch.getPoints({ id: 24 })

getPositions(param)

Get the specific positions of points, lines, arcs or circles

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: { pos: point } |
{ startPos: point, endPos: point } |
{ startPos: point, endPos: point, centerPos: point } |
{ centerPos: point } |
VOID // object containing the specific positions
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}

result information:

  • if input is a point then it returns an object containing position of the point
  • if input is a line then it returns an object containing start- and end-position of the line
  • if input is an arc then it returns an object containing start-, end- and center-position of the arc
  • if input is a circle then it returns an object containing center-position of the circle
ParamTypeDescription
paramobjectobject containing the parameters
param.idstring | real | idid of the geometry (e.g. point, line, arc, circle) to get the specific positions from

Example

res = api.v1.sketch.getPoints({ id: 24 })

point(param)

Creates one or multiple points in the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID|Array<id|VOID> // id or ids of the added points
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobject | Array<object>object or objects containing all the parameters
param.idstring | real | idid of the sketch
param.pospointposition of the point
[param.genFixation]booleanTRUEa flag which defines if fixation in the Origin should be autogenerated or not (default=TRUE)
[param.genIncidence]booleanTRUEa flag which defines if coincidence constraints between an existing and the new point should be autogenerated or not (default=TRUE)

Example

res = api.v1.sketch.point({ id: 42, pos: [0, 0, 0] })

line(param)

Creates one or multiple lines in the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID|Array<id|VOID> // id or ids of the added lines
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobject | Array<object>object or objects containing all the parameters
param.idstring | real | idid of the sketch
param.startPospointstart position of the line
param.endPospointend position of the line
[param.genFixation]booleanTRUEa flag which defines if fixation in the Origin should be autogenerated or not (default=TRUE)
[param.genIncidence]booleanTRUEa flag which defines if coincidence constraints between an existing and the new point should be autogenerated or not (default=TRUE)
[param.genTangency]booleanTRUEa flag which defines if tangency constraints between an existing curve and the new line should be autogenerated or not (default=TRUE)
[param.genVertAndHoriz]booleanTRUEa flag which defines if vertical and horizontal constraints should be autogenerated or not (default=TRUE)

Example

res = api.v1.sketch.line({ id: 42, startPos: [0, 0, 0], endPos: [10, 10, 0] })

circle(param)

Creates one or multiple circles in the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID|Array<id|VOID> // id or ids of the added circles
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobject | Array<object>object or objects containing all the parameters
param.idstring | real | idid of the sketch
param.centerPospointcenter position of the circle
param.radiusrealradius of the circle
[param.genFixation]booleanTRUEa flag which defines if fixation in the origin should be autogenerated or not (default=TRUE)
[param.genIncidence]booleanTRUEa flag which defines if coincidence constraints between an existing and the new point should be autogenerated or not (default=TRUE)

Example

res = api.v1.sketch.circle({ id: 42, centerPos: [40, 0, 0], radius: 20 })

getGeometry(param)

Get all the sketch geometry from a sketch, sketch region or rigid set

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: { points: id[], lines: id[], arcs: id[], circles: id[] } // object containing the sketch geometry
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing the parameters
param.idstring | real | idid of the sketch, sketch region or rigid set

Example

res = api.v1.sketch.getGeometry({ id: 6 })

arcByCenter(param)

Creates one or multiple arcs by center in the sketch. Arc is defined by start-, end- and center-position.

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID|Array<id|VOID> // id or ids of the added arcs
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobject | Array<object>object or objects containing all the parameters
param.idstring | real | idid of the sketch
param.startPospointstart position of the arc
param.endPospointend position of the arc
param.centerPospointcenter position of the arc
[param.isClockwise]booleanTRUEflag to define whether the arc is clockwise from start- to end-point around center-point or not (default=TRUE)
[param.genFixation]booleanTRUEa flag which defines if fixation in the origin should be autogenerated or not (default=TRUE)
[param.genIncidence]booleanTRUEa flag which defines if coincidence constraints between an existing and the new point should be autogenerated or not (default=TRUE)

Example

res = api.v1.sketch.arcByCenter({ id: 42, startPos: [-40, 0, 0], centerPos: [0, 10, 0], endPos: [40, 0, 0] })

arcBy3Points(param)

Creates one or multiple arcs by 3 points in the sketch. Arc is defined by start-, end- and mid-position.

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID|Array<id|VOID> // id or ids of the added arcs
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobject | Array<object>object or objects containing all the parameters
param.idstring | real | idid of the sketch
param.startPospointstart position of the arc
param.endPospointend position of the arc
param.midPospointmiddle position on the arc
[param.genFixation]booleanTRUEa flag which defines if fixation in the origin should be autogenerated or not (default=TRUE)
[param.genIncidence]booleanTRUEa flag which defines if coincidence constraints between an existing and the new point should be autogenerated or not (default=TRUE)

Example

res = api.v1.sketch.arcBy3Points({ id: 42, startPos: [0, 0, 0], midPos: [20, 20, 0], endPos: [40, 0, 0] })

geometry(param)

Creates one or multiple sketch geometry in the sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: { points: id[], lines: id[], arcsBy3Points: id[],
arcsByCenter: id[], circles: id[] } // object containing created sketch geometry in the order of input
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch
[param.points]Array<object>array of points to create
param.points[].pospointposition of the point
[param.lines]Array<object>array of lines to create
param.lines[].startPospointstart position of the line
param.lines[].endPospointend position of the line
[param.arcsBy3Points]Array<object>array of arcs to create by three given points
param.arcsBy3Points[].startPospointstart position of the arc
param.arcsBy3Points[].endPospointend position of the arc
param.arcsBy3Points[].midPospointmiddle position on the arc (not center)
[param.arcsByCenter]Array<object>array of arcs to create by start-, end- and center point
param.arcsByCenter[].startPospointstart position of the arc
param.arcsByCenter[].endPospointend position of the arc
param.arcsByCenter[].centerPospointcenter position of the arc
[param.arcsByCenter[].isClockwise]booleanTRUEflag to define whether the arc is clockwise from start- to end-point around center-point or not (default=TRUE)
[param.circles]Array<object>array of circles to create
param.circles[].centerPospointcenter position of the circle
param.circles[].radiusrealradius of the circle
[param.genFixation]booleanTRUEa flag which defines if fixation in the Origin should be autogenerated or not (default=TRUE)
[param.genIncidence]booleanTRUEa flag which defines if coincidence constraints between an existing point and the new point should be autogenerated or not (default=TRUE)
[param.genTangency]booleanTRUEa flag which defines if tangency constraints between an existing curve and the new curve should be autogenerated or not (default=TRUE)
[param.genVertAndHoriz]booleanTRUEa flag which defines if vertical and horizontal constraints should be autogenerated or not (default=TRUE)

Example

res = api.v1.sketch.geometry({ id: 42, points: [{ pos: [0,0,0] }, { pos: [10,10,0] }, { pos: [20,0,0]}] });
res = api.v1.sketch.geometry({ id: 42, lines: [{ startPos: [0,0,0], endPos: [0,20,0] }] );
res = api.v1.sketch.geometry({ id: 42, arcsBy3Points: [{ startPos: [0,20,0], endPos: [20,20,0], midPos: [10,30,0] }] );
res = api.v1.sketch.geometry({ id: 42, arcsByCenter: [{ startPos: [0,20,0], endPos: [20,20,0], centerPos: [10,20,0], isClockwise: FALSE }] );
res = api.v1.sketch.geometry({ id: 42, circles: [{ centerPos: [0,20,0], radius: 20 }, { centerPos: [0,40,0], radius: 10 }] );

deleteObject(param)

Deletes dimensions, constraints, sketch geometry, sketch region or rigid sets from sketch

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idsArray<(string|real|id)>ids to delete

Example

res = api.v1.sketch.deleteObject({ ids: [15, 25, 23] })

deleteSketch(param)

Deletes existing sketches

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idsstring | real | idids of the sketches to delete

Example

res = api.v1.sketch.deleteSketch({ ids: [6, 8] })

getSketchRegion(param)

Returns the id of the sketch region with the given name which belongs to the given sketch id.

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: id|VOID // id of the found sketch region
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to get the sketch region from
param.namestringthe name of the sketch region to look for

Example

res = api.v1.sketch.getSketchRegion({ id: 40, name: 'SketchRegion_Left' })

trimCurves(param)

Trims away curves, if they are suitable for trimming

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch with curves to be trimmed away
param.curveIdsArray<(string|real|id)>ids of sketch curves to be trimmed away

Example

res = api.v1.sketch.trimCurves({ id: 40, curveIds: [94, 100, 106] })

updateDimensionPosition(param)

Updates the position of the dimension text

Kind: v1.sketch function
Returns: object - object containing result and optional messages

{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the dimension to change the text position
param.pospointposition of the dimension text to update

Example

res = api.v1.sketch.updateDimensionPosition({ id: 796, pos: [50, 60, 0] })