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
}
| Param | Type | Default | Description |
|---|---|---|---|
| param | object | Array<object> | object or objects containing all the parameters | |
| param.id | string | real | id | id of the sketch | |
| param.startPos | point | start position of the arc | |
| param.endPos | point | end position of the arc | |
| param.midPos | point | middle position on the arc | |
| [param.isConstruction] | boolean | FALSE | a flag which defines if the arc is a construction geometry |
| [param.genFixation] | boolean | TRUE | a flag which defines if fixation in the origin should be autogenerated or not (default=TRUE) |
| [param.genIncidence] | boolean | TRUE | a flag which defines if coincidence constraints between an existing and the new point should be autogenerated or not (default=TRUE) |
| [param.genTangency] | boolean | FALSE | a 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
}
| Param | Type | Default | Description |
|---|---|---|---|
| param | object | Array<object> | object or objects containing all the parameters | |
| param.id | string | real | id | id of the sketch | |
| param.startPos | point | start position of the arc | |
| param.endPos | point | end position of the arc | |
| param.centerPos | point | center position of the arc | |
| [param.isClockwise] | boolean | TRUE | flag to define whether the arc is clockwise from start- to end-point around center-point or not (default=TRUE) |
| [param.isConstruction] | boolean | FALSE | a flag which defines if the arc is a construction geometry |
| [param.genFixation] | boolean | TRUE | a flag which defines if fixation in the origin should be autogenerated or not (default=TRUE) |
| [param.genIncidence] | boolean | TRUE | a 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
}
| Param | Type | Description |
|---|---|---|
| param | object | object containing all the parameters |
| param.id | string | real | id | id of the sketch which the geometry belongs to |
| param.geomId | string | real | id | id of the sketch geometry that should be relinked |
| param.refId | string | real | id | id 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
}
| Param | Type | Default | Description |
|---|---|---|---|
| param | object | Array<object> | object or objects containing all the parameters | |
| param.id | string | real | id | id of the sketch | |
| param.centerPos | point | center position of the circle | |
| param.radius | real | radius of the circle | |
| [param.isConstruction] | boolean | FALSE | a flag which defines if the circle is a construction geometry |
| [param.genFixation] | boolean | TRUE | a flag which defines if fixation in the origin should be autogenerated or not (default=TRUE) |
| [param.genIncidence] | boolean | TRUE | a 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
}
| Param | Type | Description |
|---|---|---|
| param | object | object containing all the parameters |
| param.id | string | real | id | id of the sketch to create circular pattern in |
| param.rigidSetId | string | real | id | id of the rigid set to pattern |
| param.centerId | string | real | id | id of the point to be used as an origin for rotation |
| param.angle | real | angular offset in radians between neighbouring patterned objects around rotation center |
| param.count | real | number 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
}
| Param | Type | Description |
|---|---|---|
| param | object | Array<object> | object or objects containing all the parameters |
| param.id | string | real | id | id of the sketch to create constraints in |
| [param.name] | string | name 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.geomIds | Array<(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
}
| Param | Type | Description |
|---|---|---|
| param | object | object containing all the parameters |
| param.id | string | real | id | id of the existing sketch to copy sketch geometry into it |
| param.toCopyId | string | real | id | id 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
}
| Param | Type | Default | Description |
|---|---|---|---|
| param | object | object containing all the parameters | |
| param.id | string | real | id | id of the sketch to copy object | |
| param.geomIds | Array<(string|real|id)> | ids of the sketch geometry to copy | |
| param.translation | point | offset from initial objects as translation vector | |
| [param.doCopyConstraints] | boolean | TRUE | a 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
}
| Param | Type | Default | Description |
|---|---|---|---|
| param | object | object containing all the parameters | |
| param.id | string | real | id | id of the part to create the sketch on | |
| [param.planeId] | string | real | id | id 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
}
| Param | Type | Description |
|---|---|---|
| param | object | object containing all the parameters |
| param.ids | Array<(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
}
| Param | Type | Description |
|---|---|---|
| param | object | object containing all the parameters |
| param.ids | Array<(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
}
| Param | Type | Default | Description |
|---|---|---|---|
| param | object | Array<object> | object or objects containing all the parameters | |
| param.id | string | real | id | id of the sketch to create dimensional constraints in | |
| [param.name] | string | name 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 | expression | value or expression to set for this dimensional constraint. If empty, value will be calculated automatically | |
| param.geomIds | Array<(string|real|id)> | sketch geometry like points, curves, ... which will be constrained | |
| [param.dimPos] | point | position of the dimension text, in case of type is "ANGLE", it also can be used to define which sector to be constrained | |
| [param.reflex] | boolean | FALSE | If 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
}
| Param | Type | Description |
|---|---|---|
| param | object | object containing all the parameters |
| param.id | string | real | id | id of the sketch to create the fillet in |
| param.lineIds | Array<(string|real|id)> | ids of the two lines to create the fillet at its connecting point |
| [param.offset] | real | offset 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] | real | radius 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
}
| Param | Type | Default | Description |
|---|---|---|---|
| param | object | object containing all the parameters | |
| param.id | string | real | id | id of the sketch to generat auto constraints | |
| param.geomId | string | real | id | id of the sketch geometry to auto constraint or the sketch id itself to autoconstraint each of sketch's objects | |
| [param.genFixation] | boolean | TRUE | a flag which defines if fixation in the Origin should be autogenerated or not (default=TRUE) |
| [param.genIncidence] | boolean | TRUE | a flag which defines if coincidence constraints between an existing point and the new rectangle corner should be autogenerated or not (default=TRUE) |
| [param.genTangency] | boolean | TRUE | a flag which defines if tangency constraints between an existing arc and new rectangle should be autogenerated or not (default=TRUE) |
| [param.genVertAndHoriz] | boolean | TRUE | a 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
}
| Param | Type | Default | Description |
|---|---|---|---|
| param | object | object containing all the parameters | |
| param.id | string | real | id | id of the sketch | |
| [param.points] | Array<object> | array of points to create | |
| param.points[].pos | point | position of the point | |
| [param.lines] | Array<object> | array of lines to create | |
| param.lines[].startPos | point | start position of the line | |
| param.lines[].endPos | point | end position of the line | |
| [param.lines[].isConstruction] | boolean | FALSE | a 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[].startPos | point | start position of the arc | |
| param.arcsBy3Points[].endPos | point | end position of the arc | |
| param.arcsBy3Points[].midPos | point | middle position on the arc (not center) | |
| [param.arcsBy3Points[].isConstruction] | boolean | FALSE | a 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[].startPos | point | start position of the arc | |
| param.arcsByCenter[].endPos | point | end position of the arc | |
| param.arcsByCenter[].centerPos | point | center position of the arc | |
| [param.arcsByCenter[].isClockwise] | boolean | TRUE | flag to define whether the arc is clockwise from start- to end-point around center-point or not (default=TRUE) |
| [param.arcsByCenter[].isConstruction] | boolean | FALSE | a flag which defines if the arc is a construction geometry |
| [param.circles] | Array<object> | array of circles to create | |
| param.circles[].centerPos | point | center position of the circle | |
| param.circles[].radius | real | radius of the circle | |
| [param.circles[].isConstruction] | boolean | FALSE | a flag which defines if the circle is a construction geometry |
| [param.genFixation] | boolean | TRUE | a flag which defines if fixation in the Origin should be autogenerated or not (default=TRUE) |
| [param.genIncidence] | boolean | TRUE | a flag which defines if coincidence constraints between an existing point and the new point should be autogenerated or not (default=TRUE) |
| [param.genTangency] | boolean | TRUE | a flag which defines if tangency constraints between an existing curve and the new curve should be autogenerated or not (default=TRUE) |
| [param.genVertAndHoriz] | boolean | TRUE | a 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
}
| Param | Type | Description |
|---|---|---|
| param | object | object containing all the parameters |
| param.id | string | real | id | id of the sketch |
Example
api.v1.sketch.getDiagnosticsInfo({ id: sketch })