Skip to main content

Sketch

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.isConstruction]booleanFALSEa flag which defines if the arc is a construction geometry
[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]booleanFALSEa flag which defines if tangency constraints between an existing curve and the new curve should be autogenerated or not (default=FALSE)

Example

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

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.isConstruction]booleanFALSEa flag which defines if the arc is a construction geometry
[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

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

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

api.v1.sketch.changeReferenceGeometry({ id: sketch, geomId: circle, refId: edge })

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.isConstruction]booleanFALSEa flag which defines if the circle is a construction geometry
[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

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

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

api.v1.sketch.circularPattern({ id: sketch, rigidSetId: rigidSet, centerId: id, angle: 1.57, count: 4 })

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

api.v1.sketch.constraint({ id: sketch, type: 'HORIZONTAL', geomIds: [pointId1, pointId2] })
api.v1.sketch.constraint({ id: sketch, type: 'VERTICAL', geomIds: [line] })
api.v1.sketch.constraint({ id: sketch, name: 'A', type: 'COINCIDENT', geomIds: [pointId1, pointId2] })

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

api.v1.sketch.copyFrom({ id: sketch1, toCopyId: sketch2 })

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.geomIdsArray<(string|real|id)>ids 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

api.v1.sketch.copyGeometry({ id: sketch, geomIds: [line1, line2, line, arc], translation: [20, 30, 0] })

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
}
ParamTypeDefaultDescription
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
[param.name]string"Sketch"name of the sketch (default="Sketch")

Example

api.v1.sketch.create({ id: part })
api.v1.sketch.create({ id: part, planeId: workPlane, name: 'Sketch_Top' })

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

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.idsArray<(string|real|id)>ids of the sketches to delete

Example

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

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

api.v1.sketch.dimension({ id: sketch, type: 'ANGLE', geomIds: [873, 875], dimPos: [45, 80, 0], value: '60deg' })
api.v1.sketch.dimension({ id: sketch, type: 'OFFSET', geomIds: [line1, line2] })

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

api.v1.sketch.fillet({ id: sketch, lineIds: [line1, line2], offset: 10 })
api.v1.sketch.fillet({ id: sketch, lineIds: [line1, line2], radius: 8 })

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

api.v1.sketch.generateAutoConstraints({ id: sketch, geomId: line })

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.lines[].isConstruction]booleanFALSEa flag which defines if the line is a construction geometry
[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.arcsBy3Points[].isConstruction]booleanFALSEa flag which defines if the arc is a construction geometry
[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.arcsByCenter[].isConstruction]booleanFALSEa flag which defines if the arc is a construction geometry
[param.circles]Array<object>array of circles to create
param.circles[].centerPospointcenter position of the circle
param.circles[].radiusrealradius of the circle
[param.circles[].isConstruction]booleanFALSEa flag which defines if the circle is a construction geometry
[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

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

getDiagnosticsInfo(param)

Get the info about unsatisfied constraints of the sketch

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

{
result: {
conflictingSets: {
unsatisfied: id
conflicting: id[]
entities: id[]
}[]
redundantConstraints: {
id: id
reason: "DUPLICATE"|"ALREADY_IMPLIED"|"WITHIN_RIGIDSET"|"RIGIDSETS_OVERLAP"
}[]
} // object containing the diagnostics info of the sketch
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch

Example

api.v1.sketch.getDiagnosticsInfo({ id: sketch })

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

api.v1.sketch.getGeometry({ id: sketchRegion })

getGlobalState(param)

Get the global state of the sketch

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

{
result: {
status: "FULLY_CONSTRAINED"|"OK"|"OVERDEFINED"|"NOT_SOLVED"|"UNDEFINED",
pointCount: real,
lineCount: real,
arcCount: real,
circleCount: real,
constraintCount: real,
dimensionCount: real,
solidCount: real,
constructionCount: real,
} // object containing the global state of the sketch
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch

Example

api.v1.sketch.getGlobalState({ id: sketch })

getObjectInfo(param)

Get the detailed info about the object

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

{
result: {
id: id
type: "POINT"
geometry: {
pos: point
}
constraints: id[]
dimensions: id[]
status: "FULLY_CONSTRAINED"|"OK"|"OVERDEFINED"|"UNDEFINED"
isReference: boolean
} | {
id: id
type: "LINE"
geometry: {
startId: id
endId: id
}
constraints: id[]
dimensions: id[]
status: "FULLY_CONSTRAINED"|"OK"|"OVERDEFINED"|"UNDEFINED"
isConstruction: boolean
isReference: boolean
} | {
id: id
type: "ARC"
geometry: {
startId: id
endId: id
centerId: id
radius: real
}
constraints: id[]
dimensions: id[]
status: "FULLY_CONSTRAINED"|"OK"|"OVERDEFINED"|"UNDEFINED"
isConstruction: boolean
isReference: boolean
} | {
id: id
type: "CIRCLE"
geometry: {
centerId: id
radius: real
},
constraints: id[]
dimensions: id[]
status: "FULLY_CONSTRAINED"|"OK"|"OVERDEFINED"|"UNDEFINED"
isConstruction: boolean
isReference: boolean
} | {
id: id
type: "CONSTRAINT"
entities: id[]
status: "OK"|"OVERDEFINED"|"NOT_SATISFIED"|"UNDEFINED"
isSatisfied: boolean
} | {
id: id
type: "DIMENSION"
value: real
entities: id[]
status: "OK"|"OVERDEFINED"|"NOT_SATISFIED"|"UNDEFINED"
isSatisfied: boolean
} // object containing the sketch geometry object info
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch object

Example

api.v1.sketch.getObjectInfo({ id: arc })

getObjectsLists(param)

Get the lists of ids of the sketch objects

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

{
result: {
points: id[]
lines: id[]
arcs: id[]
circles: id[]
constraints: id[]
dimensions: id[]
solidGeometry: id[]
constructionGeometry: id[]
} // object containing the lists of sketch objects
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch

Example

api.v1.sketch.getObjectsLists({ id: sketch })

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

api.v1.sketch.getPoints({ id: lineId })

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

api.v1.sketch.getPositions({ id: lineId })

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

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

getTopologyInfo(param)

Get the topology info of the sketch

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

{
result: {
intersectingCurves: {
curves: id[]
intersections: point[]
}[]
nearCoincidence: {
points: id[]
distance: real
}[]
tinyEntities: {
id: id
length: real
}[] | {
id: id
radius: real
}[]
} // object containing the topology info of the sketch
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch

Example

api.v1.sketch.getTopologyInfo({ id: sketch })

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.isConstruction]booleanFALSEa flag which defines if the line is a construction geometry
[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

api.v1.sketch.line({ id: sketch, startPos: [0, 0, 0], endPos: [10, 10, 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

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

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

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

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

api.v1.sketch.mirrorPattern({ id: sketch, rigidSetId: rigidSet, symmetryLineId: line1 })

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

api.v1.sketch.moveGeometry({ id: sketch, geomIds: [circle, line2], translation: [20, 85, 0] })

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

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

postTrim(param)

Merges the split curves back after trimming, finalizing the trim operation. This is the third step of the trim workflow: preTrim ? trim ? postTrim.

After postTrim, the sketch returns to a normal editable state with proper constraints.

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

Example

api.v1.sketch.postTrim({ id: sketch })

preTrim(param)

Splits curves at their mutual intersection points, preparing them for trimming. This is the first step of the trim workflow: preTrim ? trim ? postTrim.

If curveIds is provided, only those curves are split against each other. If curveIds is omitted, all curves in the sketch are split.

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

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

result is an array with one entry per input curve (same length as curveIds if provided). Each entry contains:

  • sourceId: the original curve id
  • splittedCurves: array of split segments, each with the resulting curve id and its [start, end] parameter interval on the original curve

After preTrim, use trim to remove unwanted splittedCurves, then postTrim to finalize.

ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch
[param.curveIds]Array<(string|real|id)>optional array of curve ids to split (lines, arcs, circles, ...). If omitted, all curves are split.

Example

api.v1.sketch.preTrim({ id: sketch })
api.v1.sketch.preTrim({ id: sketch, curveIds: [circle, line] })

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.isConstruction]booleanFALSEa flag which defines if the rectangle lines are construction geometry
[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

api.v1.sketch.rectangle({ id: sketch, 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
}
ParamTypeDefaultDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch to create the reference geometry in
param.brepIdsArray<(string|real|id)>ids of the brep elements to create sketch geometry at and reference on
[param.keepReference]booleanTRUEa flag for maintaining the referencing (default=TRUE)

Example

api.v1.sketch.referenceGeometry({ id: sketch, brepIds: [edge1, edge2, edge] })
api.v1.sketch.referenceGeometry({ id: sketch, brepIds: [edge1], keepReference: FALSE })

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

api.v1.sketch.rigidSet({ id: sketch, geomIds: [line1, arc, line2] })

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

api.v1.sketch.setReferences({ id: sketch, planeId: workPlane })

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

api.v1.sketch.setWorkPlane({ id: sketch, planeId: workPlane })

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

api.v1.sketch.sketchRegion({ id: sketch, geomIds: [arc, line1, line2, line2] })

splitAllCurves(param)

Use preTrim instead. splitAllCurves does not support subset splitting via curveIds and returns a flat array instead of structured per-curve results.

Splits all curves in the given sketch at their mutual intersection points. Used together with trimCurves and splitCurvesMergeBack.

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

{
result: Array<id|VOID> // Array of trimmable curves (flat list)
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

api.v1.sketch.splitAllCurves({ id: sketch })

splitCurve(param)

Splits curves at specified parameterized positions.

Note: This requires exact normalized parameter values [0,1] for where to cut. These values correspond to the internal curve parameterization and are typically computed by the sketcher plugin (e.g., from intersection calculations). For most use cases where you want to split at intersections, prefer the preTrim/trim/postTrim workflow which computes split positions automatically.

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

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

result is an array with one entry per input curve (same length as param.splits). Each entry contains:

  • sourceId: the original curve id
  • splittedCurves: array of split segments, each with the resulting curve id and its [start, end] parameter interval on the original curve
ParamTypeDescription
paramobjectobject containing all the parameters
param.idstring | real | idid of the sketch
param.splitsArray<object>objects containing the split information
param.splits.geomIdstring | real | idid of curve to be split
param.splits.valuesArray<real>split values in range [0,1]. Position on the curve from start to end

Example

api.v1.sketch.splitCurve({ id: sketch, splits: [{ geomId: line, values: [0.5] }] })

splitCurves(param)

Use splitCurve instead (singular). This function returns a flat array. splitCurve returns a structured result with sourceId and intervals per curve.

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.splits.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

api.v1.sketch.splitCurves({ id: sketch, splits: [{ geomId: line, values: [0.236, 0.82345124] }] })

splitCurvesMergeBack(param)

Use postTrim from trimming workflow instead.

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

api.v1.sketch.splitCurvesMergeBack({ id: sketch })

trim(param)

Removes curve segments produced by preTrim. This is the second step of the trim workflow: preTrim ? trim ? postTrim.

Pass the curve segment ids from the preTrim result to select which segments to remove.

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
param.curveIdsArray<(string|real|id)>ids of curve segments to trim away (from preTrim result)

Example

api.v1.sketch.trim({ id: sketch, curveIds: [circle, line] })

trimCurves(param)

Use trim from trimming workflow instead.

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

api.v1.sketch.trimCurves({ id: sketch, curveIds: [circle, line] })

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

api.v1.sketch.undoFillet({ id: sketch, arcId: arc })

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

api.v1.sketch.unlinkReferenceGeometry({ id: sketch, geomId: circle })

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

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

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

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

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[].idstring | real | idid of the point to update
param.points[].pospointnew position of the point
[param.lines]Array<object>array of lines to create
param.lines[].idstring | real | idid of the line to update
[param.lines[].startPos]pointnew start position of the line
[param.lines[].endPos]pointnew end position of the line
[param.lines[].isConstruction]booleanFALSEa flag which defines if the line is a construction geometry
[param.arcsBy3Points]Array<object>array of arcs to create by three given points
param.arcsBy3Points[].idstring | real | idid of the arc to update by 3 points
[param.arcsBy3Points[].startPos]pointstart position of the arc
[param.arcsBy3Points[].endPos]pointend position of the arc
param.arcsBy3Points[].midPospointmiddle position on the arc (not center)
[param.arcsBy3Points[].isConstruction]booleanFALSEa flag which defines if the arc is a construction geometry
[param.arcsByCenter]Array<object>array of arcs to create by start-, end- and center point
param.arcsByCenter[].idstring | real | idid of the arc to update by center
[param.arcsByCenter[].startPos]pointstart position of the arc
[param.arcsByCenter[].endPos]pointend position of the arc
[param.arcsByCenter[].centerPos]pointcenter 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.arcsByCenter[].isConstruction]booleanFALSEa flag which defines if the arc is a construction geometry
[param.circles]Array<object>array of circles to create
param.circles[].idstring | real | idid of the circle to update
[param.circles[].centerPos]pointcenter position of the circle
[param.circles[].radius]realradius of the circle
[param.circles[].isConstruction]booleanFALSEa flag which defines if the circle is a construction geometry

Example

api.v1.sketch.updateGeometry({
id: sketch,
points: [
{ id: pointId1, pos: [10, 50, 0] },
{ id: pointId2, pos: [10, 60, 0] },
],
})
api.v1.sketch.updateGeometry({ id: sketch, circles: [{ id: circle, centerPos: [40, 50, 0], radius: 15 }] })
api.v1.sketch.updateGeometry({ id: sketch, arcsBy3Points: [{ id: arc1, midPos: [60, 50, 0] }], arcsByCenter: [{ id: arc2, isClockwise: true }] })
api.v1.sketch.updateGeometry({ id: sketch, lines: [{ id: line, isConstruction: true }] })

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

api.v1.sketch.updateSketchRegion({ regions: [{ id: sketchRegion, geomIds: [line1, line2, line] }] })