Part
box(param)
Creates or updates a box feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the box feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create box feature in | |
[param.name] | string | "Box" | name of the box feature (default="Box") |
[param.references] | Array<(string|real|id)> | reference of the work coordinate system. If void or empty array, box is placed at drawing origin. | |
[param.length] | real | expression | 100 | length of the box in x-direction (default=100) |
[param.width] | real | expression | 100 | width of the box in y-direction (default=100) |
[param.height] | real | expression | 100 | height of the box in z-direction (default=100) |
Example
res = api.v1.part.box({ id: 4, name: 'BoxTop', references: [52] })
res = api.v1.part.box({ id: 4, name: 'BoxTop', references: [52], height: '3*65' })
updateBox(param)
Updates a box feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the box feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the box feature to update |
[param.name] | string | name of the box feature |
[param.references] | Array<(string|real|id)> | reference of the work coordinate system. If void or empty array, box is placed at drawing origin. |
[param.length] | real | expression | length of the box in x-direction |
[param.width] | real | expression | width of the box in y-direction |
[param.height] | real | expression | height of the box in z-direction |
Example
res = api.v1.part.updateBox({ id: 14, name: 'BoxTop' })
res = api.v1.part.updateBox({ id: 14, references: [52], height: '3*65' })
extrusion(param)
Creates an extrusion feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the extrusion feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create extrusion feature in | |
[param.name] | string | "Extrusion" | name of the extrusion feature (default="Extrusion") |
param.references | Array<(string|real|id)> | array of ids of the sketch contour elements, sketch regions or composite curves | |
[param.type] | "UP" | "DOWN" | "SYMMETRIC" | "CUSTOM" | "UP" | type of the extrusion (default="UP") |
[param.limit1] | real | expression | 0 | start of the extrusion (default=0), only used if type = "CUSTOM" |
[param.limit2] | real | expression | 100 | end of the extrusion (default=100) |
[param.taperAngle] | real | expression | 0 | tapers the extrusion along direction with given angle in radians (default=0) |
[param.direction] | point | expression | 1 | directon of the extrusion (default=1), only used if type = "CUSTOM" |
[param.capEnds] | boolean | TRUE | if true, extrusion ends will be capped and a solid is created, else a sheet will be created (default=TRUE) |
Example
res = api.v1.part.extrusion({ id: 4, references: [45, 89, 56, 23], limit2: 150 })
updateExtrusion(param)
Updates an extrusion feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the extrusion feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the extrusion feature to update |
[param.name] | string | name of the extrusion feature |
[param.references] | Array<(string|real|id)> | array of ids of the sketch contour elements, sketch regions or composite curves |
[param.type] | "UP" | "DOWN" | "SYMMETRIC" | "CUSTOM" | type of the extrusion |
[param.limit1] | real | expression | start of the extrusion, only used if type = "CUSTOM" |
[param.limit2] | real | expression | end of the extrusion |
[param.taperAngle] | real | expression | tapers the extrusion along direction with given angle in radians |
[param.direction] | point | expression | directon of the extrusion, only used if type = "CUSTOM" |
[param.capEnds] | boolean | if true, extrusion ends will be capped and a solid is created, else a sheet will be created |
Example
res = api.v1.part.updateExtrusion({ id: 14, references: [45, 89, 56, 23] })
mirror(param)
Creates a mirror feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the mirror feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create mirror feature in | |
[param.name] | string | "Mirror" | name of the mirror feature (default="Mirror") |
param.targets | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this mirror feature or as objects containing an id and optional indices | |
param.targets[].id | string | real | id | id of the feature, to use for this mirror feature | |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this mirror | |
param.references | Array<(string|real|id)> | selected planes or faces to mirror the solids at |
Example
res = api.v1.part.mirror({ id: 4, targets: [{ id: head }, { id: shaft }], references: [15] })
res = api.v1.part.mirror({ id: id, targets: [{ id: head, indices: [2, 4] }, { id: shaft }], references: [20] })
updateMirror(param)
Updates a mirror feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the mirror feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the mirror feature to update |
[param.name] | string | name of the mirror feature |
[param.targets] | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this mirror feature or as objects containing an id and optional indices |
param.targets[].id | string | real | id | id of the feature, to use for this mirror feature |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this mirror |
[param.references] | Array<(string|real|id)> | selected planes or faces to mirror the solids at |
Example
res = api.v1.part.updateMirror({ id: 4, references: [15] })
res = api.v1.part.updateMirror({ id: id, targets: [{ id: head }, { id: shaft }] })
getWorkGeometry(param)
Returns the id of the work geometry object with the given name from the given part or instance. Work geometry can be a workpoint, -axis, -plane or -coordinate system.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the found work geometry
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 part or instance to get the geometry from |
param.name | string | the name of the work geometry to look for |
Example
res = api.v1.part.getWorkGeometry({ id: 4, name: 'WorkCSys_Top' })
closeFeature(param)
Moves GhostRollbackBar back to RollbackBar, sets relevant entities' visibility.
Kind: v1.part 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 feature to close |
Example
res = api.v1.part.closeFeature({ id: featureId })
create([param])
Clears the drawing and creates a new part
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the new part
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
[param] | object | object containing all the parameters | |
[param.name] | string | "Part" | name of the part (default="Part") |
Example
res = api.v1.part.create({ name: 'NewPart' })
cone(param)
Creates a cone feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the cone feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create cone feature in | |
[param.name] | string | "Cone" | name of the cone feature (default="Cone") |
[param.references] | Array<(string|real|id)> | reference of the work coordinate system. If void or empty array, cone is placed at drawing origin. | |
[param.bDiameter] | real | expression | 50 | diameter at the bottom of the cone (default=50) |
[param.tDiameter] | real | expression | 0.1 | diameter at the top of the cone (default=0.1) |
[param.height] | real | expression | 100 | height of the cone (z-direction) (default=100) |
Example
res = api.v1.part.cone({ id: 4, name: 'ConeLeft', references: [52] })
res = api.v1.part.cone({ id: 4, references: [52], height: '3*diameter' })
updateCone(param)
Updates a cone feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the cone feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the cone feature to update |
[param.name] | string | name of the cone feature |
[param.references] | Array<(string|real|id)> | reference of the work coordinate system. If void or empty array, cone is placed at drawing origin. |
[param.bDiameter] | real | expression | diameter at the bottom of the cone |
[param.tDiameter] | real | expression | diameter at the top of the cone |
[param.height] | real | expression | height of the cone (z-direction) |
Example
res = api.v1.part.updateCone({ id: 4, tDiameter: 5 })
res = api.v1.part.updateCone({ id: 4, height: '3*diameter' })
cylinder(param)
Creates a cylinder feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the cylinder feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create cylinder feature in | |
[param.name] | string | "Cylinder" | name of the cylinder feature (default="Cylinder") |
[param.references] | Array<(string|real|id)> | reference of the work coordinate system. If void or empty array, cylinder is placed at drawing origin. | |
[param.diameter] | real | expression | 100 | diameter of the cylinder (default=100) |
[param.height] | real | expression | 100 | height of the cylinder in z-direction (default=100) |
Example
res = api.v1.part.cylinder({ id: 4, name: 'Cyl', references: [52] })
res = api.v1.part.cylinder({ id: 4, references: [52], height: '2*diam' })
updateCylinder(param)
Updates a cylinder feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the cone feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the cylinder feature to update |
[param.name] | string | name of the cylinder feature |
[param.references] | Array<(string|real|id)> | reference of the work coordinate system. If void or empty array, cylinder is placed at drawing origin. |
[param.diameter] | real | expression | diameter of the cylinder |
[param.height] | real | expression | height of the cylinder in z-direction |
Example
res = api.v1.part.updateCylinder({ id: 4, name: 'Cyl', references: [52] })
res = api.v1.part.updateCylinder({ id: 4, references: [52], height: '2*diam' })
sphere(param)
Creates a sphere feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the sphere feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create sphere feature in | |
[param.name] | string | "Sphere" | name of the sphere feature (default="Sphere") |
[param.references] | Array<(string|real|id)> | reference of the work coordinate system. If void or empty array, sphere is placed at drawing origin. | |
[param.radius] | real | expression | 100 | radius of the sphere (default=100) |
Example
res = api.v1.part.sphere({ id: 4, name: 'SphereCenter', references: [52] })
updateSphere(param)
Updates a sphere feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the sphere feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the sphere feature to update |
[param.name] | string | name of the sphere feature |
[param.references] | Array<(string|real|id)> | reference of the work coordinate system. If void or empty array, sphere is placed at drawing origin. |
[param.radius] | real | expression | radius of the sphere |
Example
res = api.v1.part.updateSphere({ id: 4, radius: 60 })
workCSys(param)
Creates a work coordinate system feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the work coordinate system feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create work coordinate system in | |
[param.name] | string | "WorkCSys" | name of the work coordinate system feature (default="WorkCSys") |
[param.type] | "CUSTOM" | "XYAXISORIGIN" | "CUSTOM" | type of the work coordinate system (default="CUSTOM") - "CUSTOM": means that it's created in the origin with global directions (x, y) - "XYAXISORIGIN": means that the origin and the directions can be set with references |
[param.references] | Array<(string|real|id)> | references of origin, first axis and second axis, not needed if type = "CUSTOM" | |
[param.offset] | point | expression | 0 | offset as vector along axis (default=0) |
[param.rotation] | point | expression | 0 | rotation as vector around axis in radians (default=0) |
[param.inverted] | boolean | FALSE | if true, the work coordinate system will be inverted at x-axis (default=FALSE) |
Example
res = api.v1.part.workCSys({ id: 4, offset: [100,100,0] });
res = api.v1.part.workCSys({ id: 4, type: 2, rotation: [0,0,C:PI/2] });
updateWorkCSys(param)
Updates a work coordinate system feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the work coordinate system feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the work coordinate system to update |
[param.name] | string | name of the work coordinate system feature |
[param.type] | "CUSTOM" | "XYAXISORIGIN" | type of the work coordinate system - "CUSTOM": means that it's created in the origin with global directions (x, y) - "XYAXISORIGIN": means that the origin and the directions can be set with references |
[param.references] | Array<(string|real|id)> | references of origin, first axis and second axis, not needed if type = "CUSTOM" |
[param.offset] | point | expression | offset as vector along axis |
[param.rotation] | point | expression | rotation as vector around axis in radians |
[param.inverted] | boolean | if true, the work coordinate system will be inverted at x-axis |
Example
res = api.v1.part.updateWorkCSys({ id: 4, offset: [100,100,0] });
res = api.v1.part.updateWorkCSys({ id: 4, type: 2, rotation: [0,0,C:PI/2] });
workPlane(param)
Creates a work plane feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the work plane feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create work plane in | |
[param.name] | string | "WorkPlane" | name of the work plane feature (default="WorkPlane") |
[param.type] | "USERDEFINED" | "PLANE" | "EDGEPOINT" | "3POINTS" | "POINTNORMAL" | "POINTFACE" | "LINEPLANEANGLE" | "USERDEFINED" | type of the work plane (default="USERDEFINED") - "USERDEFINED": the work plane has no reference, it's defined by normal, position and offset - "PLANE": the work plane is referenced by a plane (brep-face or work-plane), an offset can be set - "EDGEPOINT": the work plane is referenced by an edge (brep-edge, sketch-line or work-axis) and point (brep-vertex, sketch-point or work-point), an offset can be set - "3POINTS": the work plane is referenced by three points (brep-vertex, sketch-point or work-point), an offset can be set - "POINTNORMAL": the work plane is referenced by a point (brep-vertex, sketch-point or work-point) and direction (brep-edge, sketch-line or work-axis), where the direction will be the normal of the plane, an offset can be set in normal direction - "POINTFACE": the work plane is referenced by a point (brep-vertex, sketch-point or work-point) and plane (brep-face or work-plane), where the plane reference defines the normal direction of the work plane, an offset can be set - "LINEPLANEANGLE": the work plane is refereced by a line (brep-edge, sketch-line or work-axis) and plane (brep-face or work-plane), where the line's midpoint defines the position and the plane the normal of the work plane, an angle can be set to define rotation around line reference |
[param.references] | Array<(string|real|id)> | selected edges, vertices, faces, not needed if type = "USERDEFINED" | |
[param.offset] | real | expression | 0 | offset in normal direction (default=0) |
[param.angle] | real | expression | 0 | angle for type "LINEPLANEANGLE" (default=0) in radians |
[param.position] | point | expression | 0 | position of the work plane for type "USERDEFINED" (default=0) |
[param.normal] | point | expression | 0 | normal vector of the work plane for type "USERDEFINED" (default=0) |
Example
res = api.v1.part.workPlane({ id: 4, offset: 100 })
res = api.v1.part.workPlane({ id: 4, type: 16, references: [74, 82], angle: '45g' })
updateWorkPlane(param)
Updates a work plane feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the work plane feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the work plane to update |
[param.name] | string | name of the work plane feature |
[param.type] | "USERDEFINED" | "PLANE" | "EDGEPOINT" | "3POINTS" | "POINTNORMAL" | "POINTFACE" | "LINEPLANEANGLE" | type of the work plane - "USERDEFINED": the work plane has no reference, it's defined by normal, position and offset - "PLANE": the work plane is referenced by a plane (brep-face or work-plane), an offset can be set - "EDGEPOINT": the work plane is referenced by an edge (brep-edge, sketch-line or work-axis) and point (brep-vertex, sketch-point or work-point), an offset can be set - "3POINTS": the work plane is referenced by three points (brep-vertex, sketch-point or work-point), an offset can be set - "POINTNORMAL": the work plane is referenced by a point (brep-vertex, sketch-point or work-point) and direction (brep-edge, sketch-line or work-axis), where the direction will be the normal of the plane, an offset can be set in normal direction - "POINTFACE": the work plane is referenced by a point (brep-vertex, sketch-point or work-point) and plane (brep-face or work-plane), where the plane reference defines the normal direction of the work plane, an offset can be set - "LINEPLANEANGLE": the work plane is refereced by a line (brep-edge, sketch-line or work-axis) and plane (brep-face or work-plane), where the line's midpoint defines the position and the plane the normal of the work plane, an angle can be set to define rotation around line reference |
[param.references] | Array<(string|real|id)> | selected edges, vertices, faces, depends on the type |
[param.offset] | real | expression | offset in normal direction |
[param.angle] | real | expression | angle for type "LINEPLANEANGLE" in radians |
[param.position] | point | expression | position of the work plane for type "USERDEFINED" |
[param.normal] | point | expression | normal vector of the work plane for type "USERDEFINED" |
Example
res = api.v1.part.updateWorkPlane({ id: 4, offset: 100 })
res = api.v1.part.updateWorkPlane({ id: 4, type: 16, angle: '45g' })
boolean(param)
Creates a boolean feature.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the boolean feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create boolean feature in | |
[param.name] | string | name of the boolean feature (default="Union" or "Subtraction" or "Intersection") depends on the type | |
[param.type] | "UNION" | "SUBTRACTION" | "INTERSECTION" | "UNION" | type of the boolean operation (default="UNION") - "UNION": all the solids will be unified to one solid - "SUBTRACTION": all the solids will be subtracted from the first one in the array - "INTERSECTION": all the solids will be intersected with the first or the result solid of previous intersection |
param.target | string | real | id | object | target as id of the feature to use for this boolean feature or as object containing an id and optional indices | |
param.target.id | string | real | id | id of the feature, to use as base feature for this boolean operation | |
[param.target.indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this boolean | |
param.tools | Array<(string|real|id)> | Array<object> | tools as ids of the features to use for this boolean feature or as objects containing an id and optional indices | |
param.tools[].id | string | real | id | id of the feature, to use as tool feature for this boolean operation | |
[param.tools[].indices] | Array<real> | if more than one solid is appended to the tool feature, the indices can be used to specifiy which solids of the feature be used for this boolean |
Example
res = api.v1.part.boolean({ id: 4, target: { id: head }, tools: [{ id: shaft }] })
updateBoolean(param)
Updates a boolean feature.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the boolean feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the boolean feature to update |
[param.name] | string | name of the boolean feature depends on the type |
[param.type] | "UNION" | "SUBTRACTION" | "INTERSECTION" | type of the boolean operation - "UNION": all the solids will be unified to one solid - "SUBTRACTION": all the solids will be subtracted from the first one in the array - "INTERSECTION": all the solids will be intersected with the first or the result solid of previous intersection |
[param.target] | object | target containing an id and optional indices |
param.target.id | string | real | id | id of the feature, to use as base feature for this boolean operation |
[param.target.indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this boolean |
[param.tools] | Array<(string|real|id)> | Array<object> | tools as ids of the features to use for this boolean feature or as objects containing an id and optional indices |
param.tools[].id | string | real | id | id of the feature, to use as tool feature for this boolean operation |
[param.tools[].indices] | Array<real> | if more than one solid is appended to the tool feature, the indices can be used to specifiy which solids of the feature be used for this boolean |
Example
res = api.v1.part.updateBoolean({ id: 4, type: 'INTERSECTION' })
expression(param)
Creates expressions in different products
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: boolean // true if everything is fine, false if adding expression was not successful
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | Array<object> | object or objects containing the parameters |
param.id | string | real | id | id or identifier of the product where the expressions wanted to be created |
[param.toCreate] | Array<object> | array of expressions to be created |
param.toCreate.name | string | name of the expression to create |
param.toCreate.value | real | string | value of to create expression |
Example
res = api.v1.part.expression({ id: 4, toCreate: [{ name: 'height', value: 50 }] })
revolve(param)
Creates or updates a revolve feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the revolve feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create revolve feature in | |
[param.name] | string | "Revolve" | name of the revolve feature (default="Revolve") |
param.references | Array<(string|real|id)> | array of ids of the sketch contour elements, sketch regions or composite curves | |
param.axisIds | Array<(string|real|id)> | array of ids, either a line (brep-edge, sketch-line or work-axis) or two points (brep-vertex, sketch-point or work-point) | |
[param.startAngle] | real | expression | 0 | start angle of the revolve in radians (default=0) |
[param.endAngle] | real | expression | 2*C:PI | end angle of the revolve in radians (default=2*C:PI) |
[param.inverted] | boolean | FALSE | if true, rotation direction around axis is cw, if false ccw (default=FALSE) |
Example
res = api.v1.part.revolve({ id: 4, references: sketchLines, axisIds: [12] });
res = api.v1.part.revolve({ id: 4, references: sketchLines, axisIds: [12], startAngle: "C:PI/2", endAngle: C:PI });
updateRevolve(param)
Updates a revolve feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the revolve feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the revolve feature to update |
[param.name] | string | name of the revolve feature |
[param.references] | Array<(string|real|id)> | array of ids of the sketch contour elements, sketch regions or composite curves |
[param.axisIds] | Array<(string|real|id)> | array of ids, either a line (brep-edge, sketch-line or work-axis) or two points (brep-vertex, sketch-point or work-point) |
[param.startAngle] | real | expression | start angle of the revolve in radians |
[param.endAngle] | real | expression | end angle of the revolve in radians |
[param.inverted] | boolean | if true, rotation direction around axis is cw, if false ccw |
Example
res = api.v1.part.updateRevolve({ id: 4, startAngle: 30g });
res = api.v1.part.updateRevolve({ id: 4, inverted: TRUE });
workAxis(param)
Creates a work axis feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the work axis feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create work axis in | |
[param.name] | string | "WorkAxis" | name of the work axis feature (default="WorkAxis") |
[param.type] | "USERDEFINED" | "POINTDIRECTION" | "CURVE" | "2POINTS" | "2PLANES" | "USERDEFINED" | type of the work axis (default="USERDEFINED") - "USERDEFINED": the work axis has no reference, it's defined by position and direction - "POINTDIRECTION": the work axis is referenced by a point (brep-vertex, sketch-point or work-point) and direction (brep-edge, sketch-line or work-axis) - "CURVE": the work axis is referenced by curve (brep-edge, sketch-line or work-axis) - "2POINTS": the work axis is referenced by two points (brep-vertex, sketch-point or work-point) - "2PLANES": the work axis is referenced by two planes (brep-face or work-plane) |
[param.references] | Array<(string|real|id)> | selected edges, vertices, faces, not needed if type = "USERDEFINED" | |
[param.position] | point | expression | 0 | position of the work axis for type "USERDEFINED" (default=0) |
[param.direction] | point | expression | 0 | normal vector of the work axis for type "USERDEFINED" (default=0) TODO: default changed in member to 0? |
Example
res = api.v1.part.workAxis({ id: 4, position: [0, 50, 0], direction: [1, 0, 0] })
updateWorkAxis(param)
Updates a work axis feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the work axis feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the work axis to update |
[param.name] | string | name of the work axis feature |
[param.type] | "USERDEFINED" | "POINTDIRECTION" | "CURVE" | "2POINTS" | "2PLANES" | type of the work axis - "USERDEFINED": the work axis has no reference, it's defined by position and direction - "POINTDIRECTION": the work axis is referenced by a point (brep-vertex, sketch-point or work-point) and direction (brep-edge, sketch-line or work-axis) - "CURVE": the work axis is referenced by curve (brep-edge, sketch-line or work-axis) - "2POINTS": the work axis is referenced by two points (brep-vertex, sketch-point or work-point) - "2PLANES": the work axis is referenced by two planes (brep-face or work-plane) |
[param.references] | Array<(string|real|id)> | selected edges, vertices, faces, not needed if type = "USERDEFINED" |
[param.position] | point | expression | position of the work axis for type "USERDEFINED" |
[param.direction] | point | expression | normal vector of the work axis for type "USERDEFINED" TODO: default changed in member to 0? |
Example
res = api.v1.part.updateWorkAxis({ id: 4, position: [0, 150, 0], direction: [1, 1, 0] })
linearPattern(param)
Creates a linear pattern feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the linear pattern feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create linear pattern feature in | |
[param.name] | string | "LinearPattern" | name of the linear pattern feature (default="LinearPattern") |
param.targets | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this linear pattern feature or as objects containing an id and optional indices | |
param.targets[].id | string | real | id | id of the feature, to use for this linear pattern | |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the feature, the indices can be used to select the solids | |
param.dir1 | object | object containing the parameters for the first direction of the linear pattern | |
param.dir1.references | Array<(string|real|id)> | selected line or points defining the first direction of the linear pattern | |
[param.dir1.inverted] | boolean | FALSE | if true, the first direction of the pattern will be inverted (default=FALSE) |
[param.dir1.distance] | real | expression | 0 | distance between entities along first direction of linear pattern (default=0) |
[param.dir1.count] | real | expression | 2 | number of entities along first direction of linear pattern (default=2) |
[param.dir1.merged] | boolean | FALSE | if true, entities of the linear pattern will be merged to one entity (default=FALSE) |
[param.dir2] | object | object containing the parameters for the second direction of the linear pattern | |
param.dir2.references | Array<(string|real|id)> | selected line or points defining the second direction of the linear pattern | |
[param.dir2.inverted] | boolean | FALSE | if true, the second direction of the pattern will be inverted (default=FALSE) |
[param.dir2.distance] | real | expression | 0 | distance between entities along second direction of linear pattern (default=0) |
[param.dir2.count] | real | expression | 1 | number of entities along second direction of linear pattern (default=1) |
Example
res = api.v1.part.linearPattern({ id: 4, targets: [{ id: head }], dir1: { references: [15], distance: 150, count: 4 } })
res = api.v1.part.linearPattern({
id: 4,
targets: [{ id: head }],
dir1: { references: [15], distance: '150/3', merged: TRUE },
})
updateLinearPattern(param)
Updates a linear pattern feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the linear pattern feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the linear pattern feature to update |
[param.name] | string | name of the liinear pattern feature |
[param.targets] | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this linear pattern feature or as objects containing an id and optional indices |
param.targets[].id | string | real | id | id of the feature, to use for this linear pattern |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the feature, the indices can be used to select the solids |
[param.dir1] | object | object containing the parameters for the first direction of the linear pattern |
[param.dir1.references] | Array<(string|real|id)> | selected line or points defining the first direction of the linear pattern |
[param.dir1.inverted] | boolean | if true, the first direction of the pattern will be inverted |
[param.dir1.distance] | real | expression | distance between entities along first direction of linear pattern |
[param.dir1.count] | real | expression | number of entities along first direction of linear pattern |
[param.dir1.merged] | boolean | if true, entities of the linear pattern will be merged to one entity |
[param.dir2] | object | object containing the parameters for the second direction of the linear pattern |
[param.dir2.references] | Array<(string|real|id)> | selected line or points defining the second direction of the linear pattern |
[param.dir2.inverted] | boolean | if true, the second direction of the pattern will be inverted |
[param.dir2.distance] | real | expression | distance between entities along second direction of linear pattern |
[param.dir2.count] | real | expression | number of entities along second direction of linear pattern |
Example
res = api.v1.part.updateLinearPattern({ id: 4, dir1: { references: [15], distance: 150, count: 4 } })
res = api.v1.part.updateLinearPattern({ id: 4, dir1: { merged: FALSE } })
circularPattern(param)
Creates a circular pattern feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the circular pattern feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create circular pattern feature in | |
[param.name] | string | "CircularPattern" | name of the mirror feature (default="CircularPattern") |
param.targets | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this circular pattern feature or as objects containing an id and optional indices | |
param.targets[].id | string | real | id | id of the feature, to use for this circular pattern | |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the feature, the indices can be used to select the solids | |
param.references | Array<(string|real|id)> | selected line or points defining the axis of the circular pattern | |
[param.inverted] | boolean | FALSE | if true, the rotation around axis of the pattern will be inverted (default=FALSE) |
[param.angle] | real | expression | 0 | angle between entities around axis of circular pattern (default=0) |
[param.count] | real | expression | 2 | number of entities around axis of circular pattern (default=2) |
[param.merged] | boolean | FALSE | if true, entities of the circular pattern will be merged to one entity (default=FALSE) |
Example
res = api.v1.part.circularPattern({
id: part,
targets: [{ id: head }],
references: [15],
angle: '45g',
count: 8,
merged: FALSE,
})
updateCircularPattern(param)
Updates a circular pattern feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the circular pattern feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the circular pattern feature to update |
[param.name] | string | name of the mirror feature |
[param.targets] | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this circular pattern feature or as objects containing an id and optional indices |
param.targets[].id | string | real | id | id of the feature, to use for this circular pattern |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the feature, the indices can be used to select the solids |
[param.references] | Array<(string|real|id)> | selected line or points defining the axis of the circular pattern |
[param.inverted] | boolean | if true, the rotation around axis of the pattern will be inverted (default=FALSE) |
[param.angle] | real | expression | angle between entities around axis of circular pattern |
[param.count] | real | expression | number of entities around axis of circular pattern |
[param.merged] | boolean | if true, entities of the circular pattern will be merged to one entity |
Example
res = api.v1.part.updateCircularPattern({ id: feature, angle: '45g', count: 8, merged: FALSE })
chamfer(param)
Creates a chamfer feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the chamfer feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create chamfer feature in | |
[param.name] | string | "Chamfer" | name of the chamfer feature (default="Chamfer") |
param.references | Array<(string|real|id)> | selected brep edges to create chamfer on | |
[param.type] | "EQUAL_DISTANCE" | "TWO_DISTANCES" | "DISTANCE_ANGLE" | "EQUAL_DISTANCE" | type of the chamfer (default="EQUAL_DISTANCE") |
[param.distance1] | real | expression | 2 | distance1 of the chamfer (default=2) for all types |
[param.distance2] | real | expression | 2 | distance2 of the chamfer (default=2) for type = "TWO_DISTANCES" |
[param.angle] | real | expression | C:PI/4 | angle of the chamfer (default=C:PI/4) for type = "DISTANCE_ANGLE" |
Example
res = api.v1.part.chamfer({ id: 4, name: 'ChamferTop', references: [15, 20, 25] })
res = api.v1.part.chamfer({ id: 4, type: 'DISTANCE_ANGLE', references: [76], distance1: 10, angle: 'C:PI/6' })
updateChamfer(param)
Updates a chamfer feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the chamfer feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the chamfer feature to update |
[param.name] | string | name of the chamfer feature |
[param.references] | Array<(string|real|id)> | selected brep edges to create chamfer on |
[param.type] | "EQUAL_DISTANCE" | "TWO_DISTANCES" | "DISTANCE_ANGLE" | type of the chamfer |
[param.distance1] | real | expression | distance1 of the chamfer for all types |
[param.distance2] | real | expression | distance2 of the chamfer for type = "TWO_DISTANCES" |
[param.angle] | real | expression | angle of the chamfer for type = "DISTANCE_ANGLE" |
Example
res = api.v1.part.updateChamfer({ id: 4, name: 'Chamfer' })
res = api.v1.part.updateChamfer({ id: 4, type: 'DISTANCE_ANGLE', distance1: 10, angle: 'C:PI/6' })
fillet(param)
Creates a fillet feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the fillet feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create fillet feature in | |
[param.name] | string | "Fillet" | name of the fillet feature (default="Fillet") |
param.references | Array<(string|real|id)> | selected brep edges to create fillet on | |
[param.radius] | real | expression | 2 | radius of the fillet (default=2) |
Example
res = api.v1.part.fillet({ id: 4, name: 'FilletTop', references: [15, 20, 25] })
res = api.v1.part.fillet({ id: 4, name: 'FilletTop', references: [15, 20, 25], radius: '5/2' })
updateFillet(param)
Updates a fillet feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the fillet feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the fillet feature to update |
[param.name] | string | name of the fillet feature |
[param.references] | Array<(string|real|id)> | selected brep edges to create fillet on |
[param.radius] | real | expression | radius of the fillet |
Example
res = api.v1.part.updateFillet({ id: 4, name: 'Fillet' })
res = api.v1.part.updateFillet({ id: 4, radius: '5/2' })
entityDeletion(param)
Creates a entity deletion feature.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the entitiy deletion feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create entity deletion feature in | |
[param.name] | string | "EntityDeletion" | name of the entity deletion feature (default="EntityDeletion") |
param.targets | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this entity deletion feature or as objects containing an id and optional indices | |
param.targets[].id | string | real | id | id of the feature, to use for this deletion feature | |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this entity deletion |
Example
res = api.v1.part.entityDeletion({ id: 4, targets: [{ id: 15, indices: [0, 2, 4] }] })
updateEntityDeletion(param)
Updates an existing entity deletion feature.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the entitiy deletion feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the entity deletion feature to update |
[param.name] | string | name of the entity deletion feature |
[param.targets] | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this entity deletion feature or as objects containing an id and optional indices |
param.targets[].id | string | real | id | id of the feature, to use for this deletion feature |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this entity deletion |
Example
res = api.v1.part.updateEntityDeletion({ id: 4, targets: [{ id: 15, indices: [0, 2, 4] }] })
openFeature(param)
Moves GhostRollbackBar to the position before passed feature, sets relevant entities' visibility.
Kind: v1.part 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 feature to open |
Example
res = api.v1.part.openFeature({ id: 78 })
operationMoveBefore(param)
Moves the rollback bar to the position right before the provided feature (backwards or forwards) and sets the entities of the current feature visible. If changes on a feature have been made and the rollback bar will be forwarded (to end direction), a recalculation of the features will be made.
Kind: v1.part 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 part to move the rollback bar |
param.featureId | string | real | id | id of the feature to move the rollback bar before |
Example
res = api.v1.part.operationMoveBefore({ id: 56, featureId: 89 })
operationMoveToEnd(param)
Moves the rollback bar to the latest feature and sets the entities of the current feature visible. If changes on a feature have been made, a recalculation of the features will be made.
Kind: v1.part 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 part to move the rollback bar to the end |
Example
res = api.v1.part.operationMoveToEnd({ id: 56, featureId: 89 })
getFeature(param)
Returns the id of the feature with the given name from the given part.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the found feature
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 part to get the feature from |
param.name | string | the name of the feature to look for |
Example
res = api.v1.part.getFeature({ id: 69, name: 'Chamfer' })
slice(param)
Creates a slice feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the slice feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create slice feature in | |
[param.name] | string | "Slice" | name of the slice feature (default="Slice") |
param.targets | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this slice feature or as objects containing an id and optional indices | |
param.targets[].id | string | real | id | id of the feature, to use for this slice feature | |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this slice | |
[param.reference] | string | real | id | selected work plane to slice the solids at | |
[param.inverted] | boolean | FALSE | if false, the solid which is on the side along normal vector of the work plane will be kept (default=FALSE) |
Example
res = api.v1.part.slice({ id: 4, targets: [{ id: chamfer }], reference: 25 })
updateSlice(param)
Updates a slice feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the slice feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the slice feature to update |
[param.name] | string | name of the slice feature |
[param.targets] | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this slice feature or as objects containing an id and optional indices |
param.targets[].id | string | real | id | id of the feature, to use for this slice feature |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this slice |
[param.reference] | string | real | id | selected work plane to slice the solids at |
[param.inverted] | boolean | if false, the solid which is on the side along normal vector of the work plane will be kept |
Example
res = api.v1.part.updateSlice({ id: 4, inverted: TRUE })
sliceBySheet(param)
Creates a slice by sheet feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the slice by sheet feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create slice by sheet feature in | |
[param.name] | string | "SliceBySheet" | name of the slice by sheet feature (default="SliceBySheet") |
param.target | string | real | id | object | target as id of the feature to use for this slice by sheet feature or as object containing an id and optional indices | |
param.target.id | string | real | id | id of the feature, to use for this slice by sheet feature | |
[param.target.indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this slice by sheet | |
param.tool | string | real | id | object | tool as id of the feature to use for this slice by sheet feature or as object containing an id and optional indices | |
param.tool.id | string | real | id | id of the feature containing a sheet, to use for this slice by sheet feature | |
[param.tool.indices] | Array<real> | if more than one solid is appended to the tool feature, the indices can be used to specifiy which solids of the feature be used for this slice by sheet | |
[param.inverted] | boolean | FALSE | if false, the solid which is on the side along normal vector of the work plane will be kept (default=FALSE) |
Example
res = api.v1.part.sliceBySheet({ id: 4, target: { id: box }, tool: { id: extrusion } })
updateSliceBySheet(param)
Updates a slice by sheet feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the slice by sheet feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the slice by sheet feature to update |
[param.name] | string | name of the slice by sheet feature |
[param.target] | object | target containing an id and optional indices |
param.target.id | string | real | id | id of the feature, to use for this slice by sheet feature |
[param.target.indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this slice by sheet |
[param.tool] | object | tool containing an id and optional indices |
param.tool.id | string | real | id | id of the feature containing a sheet, to use for this slice by sheet feature |
[param.tool.indices] | Array<real> | if more than one solid is appended to the tool feature, the indices can be used to specifiy which solids of the feature be used for this slice by sheet |
[param.inverted] | boolean | if false, the solid which is on the side along normal vector of the work plane will be kept |
Example
res = api.v1.part.updateSliceBySheet({ id: 4, inverted: TRUE })
importFeature(param)
Creates an import feature. This allows to import other data like STP into the part. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the import feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create import feature in | |
[param.name] | string | "Import" | name of the import feature (default="Import") |
[param.url] | string | url to import model from | |
[param.file] | string | full path of the file. Path has to be a for the ClassCAD process reachable local or UNC path. | |
[param.data] | string | data/content of the model to import | |
[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] | "STP" | "STP" | content format of imported model (default="STP") |
Example
res = api.v1.part.importFeature({ id: 4, url: 'https://.../Filename.stp', format: 'STP', name: 'Import' })
res = api.v1.part.importFeature({ id: 4, data: 'xx124b', format: 'STP', name: 'Import' })
res = api.v1.part.importFeature({ id: 4, file: '/var/models/file.stp', format: 'STP', name: 'Import' })
updateImportFeature(param)
Updates an import feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the import feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the import feature to update |
[param.name] | string | name of the import feature |
[param.url] | string | url to import model from |
[param.file] | string | full path of the file. Path has to be a for the ClassCAD process reachable local or UNC path. |
[param.data] | string | data/content of the model to import |
[param.format] | "STP" | content format of imported model |
Example
res = api.v1.part.updateImportFeature({ id: 4, name: 'ImportNew' })
setAppearance(param)
Sets the appearance on the target, which is here defined by an id which is the feature and optional inidices to select specific solids from the feature, if more than one solid is appended.
Kind: v1.part 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 or objects containing the parameters |
param.target | string | real | id | object | target as id of the feature to set appearance or as object containing an id and optional indices |
param.target.id | string | real | id | id of the feature, to set the appearance on |
[param.target.indices] | Array<real> | if more than one solid is appended to the feature, the indices can be used to select the solids |
[param.color] | Array<real> | array of three elements (rgb color), color[0] = r, color[1] = g, color[2] = b |
[param.transparency] | real | value of transparency between 0 and 1 |
[param.chordHeightTol] | real | chord height tolerance |
[param.angleTol] | real | angle tolerance |
Example
res = api.v1.part.setAppearance({ target: { id: 58 }, color: [10, 125, 250], transparency: 0.5 })
res = api.v1.part.setAppearance({ target: { id: 58 }, chordHeightTol: 0.5, angleTol: 20 })
twist(param)
Creates a twist feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the twist feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create twist feature in | |
[param.name] | string | "Twist" | name of the twist feature (default="Twist") |
param.references | Array<(string|real|id)> | array of ids of the sketch contour elements, sketch regions or composite curves | |
[param.type] | "UP" | "DOWN" | "SYMMETRIC" | "CUSTOM" | "UP" | type of the twist (default="UP") |
[param.limit1] | real | expression | 0 | start of the twist (default=0), only used if type = "CUSTOM" |
[param.limit2] | real | expression | 100 | end of the twist (default=100) |
[param.twistAngle] | real | expression | 0 | tapers the twist along direction with given angle in radians (default=0) |
[param.twistCenter] | point | expression | 0 | point which together with direction defines the twist axis. The actual center/start of the twist is where the defined twist axis intersects the sketch plane (default=0), only used if type = "CUSTOM" |
[param.direction] | point | expression | 1 | directon of the twist (default=1), only used if type = "CUSTOM" |
[param.capEnds] | boolean | TRUE | if true, twist ends will be capped and a solid is created, else a sheet will be created (default=TRUE) |
Example
res = api.v1.part.twist({ id: 4, references: sketchLines, twistAngle: 90g, limit2: 200, direction: {0,1,1}, type: 0 });
res = api.v1.part.twist({ id: 4, references: sketchLines, twistAngle: C:PI, limit2: "2*50" });
res = api.v1.part.twist({ id: 4, references: sketchLines, twistAngle: "2*C:PI", });
res = api.v1.part.twist({ id: 4, references: sketchLines, twistAngle: "2*45g", limit1: "25+15", limit2: 150, type: 3 });
updateTwist(param)
Updates a twist feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the twist feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the twist feature to update |
[param.name] | string | name of the twist feature |
[param.references] | Array<(string|real|id)> | array of ids of the sketch contour elements, sketch regions or composite curves |
[param.type] | "UP" | "DOWN" | "SYMMETRIC" | "CUSTOM" | type of the twist |
[param.limit1] | real | expression | start of the twist, only used if type = "CUSTOM" |
[param.limit2] | real | expression | end of the twist |
[param.twistAngle] | real | expression | tapers the twist along direction with given angle in radians |
[param.twistCenter] | point | expression | point which together with direction defines the twist axis. The actual center/start of the twist is where the defined twist axis intersects the sketch plane, only used if type = "CUSTOM" |
[param.direction] | point | expression | directon of the twist, only used if type = "CUSTOM" |
[param.capEnds] | boolean | if true, twist ends will be capped and a solid is created, else a sheet will be created |
Example
res = api.v1.part.updateTwist({ id: 4, twistAngle: 90g, limit2: 200, direction: {0,1,1}, type: 0 });
res = api.v1.part.updateTwist({ id: 4, twistAngle: C:PI, limit2: "2*50" });
res = api.v1.part.updateTwist({ id: 4, twistAngle: "2*C:PI", });
res = api.v1.part.updateTwist({ id: 4, references: [111,123,125], twistAngle: "2*45g", capEnds: FALSE });
workPoint(param)
Creates a work point feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the work point feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create work point in | |
[param.name] | string | "WorkPoint" | name of the work point feature (default="WorkPoint") |
[param.type] | "USERDEFINED" | "BREPVERTEX" | "EDGEMIDPOINT" | "CENTER" | "BARYCENTER" | "INTERSECTION" | "INNERCIRCLE" | "2POINTS" | "USERDEFINED" | type of the work point (default="USERDEFINED") - "USERDEFINED": the work point has no reference, it's defined by position - "BREPVERTEX": the work point is referenced by a point (brep-vertex or sketch-point) at its position - "EDGEMIDPOINT": the work point is referenced by curve (brep-edge or sketch-line) at its mid point - "CENTER": the work point is referenced by a curve/circle (brep-vertex or sketch-line) at their center - "BARYCENTER": the work point is referenced by a plane (brep-face or work-plane) at its bary center - "INTERSECTION": the work point is referenced by two curves (brep-edge or sketch-line) at their intersection - "INNERCIRCLE": the work point is referenced by three curves (brep-edge or sketch-line) at their inner cirlce - "2POINTS": the work point is referenced by two points (brep-vertex or sketch-point) at the middle of them |
[param.references] | Array<(string|real|id)> | selected edges, vertices, faces, not needed if type = "USERDEFINED" | |
[param.position] | point | expression | 0 | position of the work point for type "USERDEFINED" (default=0) |
Example
res = api.v1.part.workPoint({ id: 4, position: [0, 50, 0] })
updateWorkPoint(param)
Updates a work point feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the work point feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the work point to update | |
[param.name] | string | "WorkPoint" | name of the work point feature (default="WorkPoint") |
[param.type] | "USERDEFINED" | "BREPVERTEX" | "EDGEMIDPOINT" | "CENTER" | "BARYCENTER" | "INTERSECTION" | "INNERCIRCLE" | "2POINTS" | type of the work point - "USERDEFINED": the work point has no reference, it's defined by position - "BREPVERTEX": the work point is referenced by a point (brep-vertex or sketch-point) at its position - "EDGEMIDPOINT": the work point is referenced by curve (brep-edge or sketch-line) at its mid point - "CENTER": the work point is referenced by a curve/circle (brep-vertex or sketch-line) at their center - "BARYCENTER": the work point is referenced by a plane (brep-face or work-plane) at its bary center - "INTERSECTION": the work point is referenced by two curves (brep-edge or sketch-line) at their intersection - "INNERCIRCLE": the work point is referenced by three curves (brep-edge or sketch-line) at their inner cirlce - "2POINTS": the work point is referenced by two points (brep-vertex or sketch-point) at the middle of them | |
[param.references] | Array<(string|real|id)> | selected edges, vertices, faces, not needed if type = "USERDEFINED" | |
[param.position] | point | expression | position of the work point for type "USERDEFINED" |
Example
res = api.v1.part.updateWorkPoint({ id: 4, position: [60, 50, 0] })
compositeCurve(param)
Creates a composite curve feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the composite curve feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create composite curve feature in | |
[param.name] | string | "CompositeCurve" | name of the composite curve feature (default="CompositeCurve") |
param.references | Array<(string|real|id)> | selected curves to build the composite curve from |
Example
res = api.v1.part.compositeCurve({ id: 4, references: curves })
updateCompositeCurve(param)
Updates a composite curve feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the composite curve feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the composite curve feature to update |
[param.name] | string | name of the composite curve feature |
[param.references] | Array<(string|real|id)> | selected curves to build the composite curve from |
Example
res = api.v1.part.updateCompositeCurve({ id: 4, references: [56, 69, 98, 74] })
unlinkExpression(param)
Unlinks expression from dimensional constraints in sketcher or parameter in feature
Kind: v1.part 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 the parameters |
param.id | string | real | id | id of the dimension or feature where to unlink an expression |
param.name | string | name of the parameter which will be disconnected from expression |
Example
res = api.v1.part.unlinkExpression({ id: 14, name: 'height' })
linkWithExpression(param)
Connects an expression with a dimensional constraint in a sketch or a parameter in a feature
Kind: v1.part 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 the parameters |
param.id | string | real | id | id of the dimension or feature where to link an expression |
param.exprName | string | name of the expression to link |
param.name | string | parameter in feature which will be connected to the expression |
Example
res = api.v1.part.linkWithExpression({ id: 14, exprName: 'length', name: 'limit2' })
deleteDimension(param)
Deletes dimensions from feature
Kind: v1.part 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 feature dimensions to delete |
Example
res = api.v1.part.deleteDimension({ ids: [59] })
getSketch(param)
Returns the id of the sketch with the given name from the given part.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the found 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 part to get the sketch from |
param.name | string | the name of the sketch to look for |
Example
res = api.v1.part.getSketch({ id: 4, name: 'Sketch_Front' })
entityInjection(param)
Creates a new entity injection. This feature can be used to inject entities like solids or curves into a part, created with the Solid- and CurveAPI.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the entity injection
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
[param.id] | string | real | id | id of the part to create entity injection in | |
[param.name] | string | "EntityInjection" | name of the entity injection feature (default="EntityInjection") |
Example
res = api.v1.part.entityInjection({ id: 4 })
createUncommitedObject(param)
Attention: This method should only be used, if the intention is very clear. Creates a new uncommited (empty) feature in the given part.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the created object
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 part to create the uncommited object in |
param.type | string | the type of object to be created |
param.name | string | the name of the object to be created |
Example
res = api.v1.part.createUncommitedObject({ id: 4, type: 'CC_Box', name: 'Box' })
translation(param)
Creates a translation feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the translation feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create translation feature in | |
[param.name] | string | "Translation" | name of the translation feature (default="Translation") |
param.targets | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this translation feature or as objects containing an id and optional indices | |
param.targets[].id | string | real | id | id of the feature, to use for this translation feature | |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this translation | |
param.references | Array<(string|real|id)> | array of ids, either a line (brep-edge, sketch-line or work-axis) or two points (brep-vertex, sketch-point or work-point) expected | |
[param.distance] | real | expression | 0 | distance of the translation (default=0) |
[param.inverted] | boolean | FALSE | if false, the direction of translation will be inverted (default=FALSE) |
Example
res = api.v1.part.translation({ id: 4, targets: [{ id: chamfer }], references: [15], distance: 50 })
updateTranslation(param)
Updates a translation feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the translate feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the translation feature to update |
[param.name] | string | name of the translation feature |
[param.targets] | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this translation feature or as objects containing an id and optional indices |
param.targets[].id | string | real | id | id of the feature, to use for this translation feature |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this translation |
[param.references] | Array<(string|real|id)> | array of ids, either a line (brep-edge, sketch-line or work-axis) or two points (brep-vertex, sketch-point or work-point) expected |
[param.distance] | real | expression | distance of the translation |
[param.inverted] | boolean | if false, the direction of translation will be inverted |
Example
res = api.v1.part.updateTranslation({ id: 4, distance: 520 })
rotation(param)
Creates a rotation feature. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the rotation feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create rotation feature in | |
[param.name] | string | "Rotation" | name of the rotation feature (default="Rotation") |
param.targets | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this rotation feature or as objects containing an id and optional indices | |
param.targets[].id | string | real | id | id of the feature, to use for this rotation feature | |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this rotation | |
param.references | Array<(string|real|id)> | array of ids, either a line (brep-edge, sketch-line or work-axis) or two points (brep-vertex, sketch-point or work-point) expected | |
[param.angle] | real | expression | 0 | angle of the rotation in radians (default=0) |
[param.inverted] | boolean | FALSE | if false, the direction of rotation will be inverted (default=FALSE) |
Example
res = api.v1.part.rotation({ id: 4, targets: [{ id: chamfer }], references: [15], angle: C:PI });
updateRotation(param)
Updates a rotation feature. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the rotation feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the rotation feature to update |
[param.name] | string | name of the rotation feature |
[param.targets] | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this rotation feature or as objects containing an id and optional indices |
param.targets[].id | string | real | id | id of the feature, to use for this rotation feature |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this rotation |
[param.references] | Array<(string|real|id)> | array of ids, either a line (brep-edge, sketch-line or work-axis) or two points (brep-vertex, sketch-point or work-point) expected |
[param.angle] | real | expression | angle of the rotation in radians |
[param.inverted] | boolean | if false, the direction of rotation will be inverted |
Example
res = api.v1.part.updateRotation({ id: 4, targets: [{ id: chamfer }], references: [15], angle: C:PI });
transformationByCSys(param)
Creates a transformation by csys feature. The transformation is the matrix between first and second work coordinate system. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the transformation by csys feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | object containing the parameters | |
param.id | string | real | id | id of the part to create transformation by csys feature in | |
[param.name] | string | "TransformationByCSys" | name of the transformation by csys feature (default="TransformationByCSys") |
param.targets | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this transformation by csys feature or as objects containing an id and optional indices | |
param.targets[].id | string | real | id | id of the feature, to use for this transformation by csys feature | |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this transformation by csys | |
param.references | Array<(string|real|id)> | two work coordinate systems are needed, whereas at index 0 the wcs "to" and at index 1 the wcs "from" is expected |
Example
res = api.v1.part.transformationByCSys({ id: 4, targets: [{ id: chamfer }], references: [15, 18] })
updateTransformationByCSys(param)
Updates a transformation by csys feature. The transformation is the matrix between first and second work coordinate system. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the transformation by csys feature
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the transformation by csys feature to update |
[param.name] | string | name of the transformation by csys feature |
[param.targets] | Array<(string|real|id)> | Array<object> | targets as ids of the features to use for this transformation by csys feature or as objects containing an id and optional indices |
param.targets[].id | string | real | id | id of the feature, to use for this transformation by csys feature |
[param.targets[].indices] | Array<real> | if more than one solid is appended to the target feature, the indices can be used to specifiy which solids of the feature be used for this transform by csys |
[param.references] | Array<(string|real|id)> | two work coordinate systems are needed, whereas at index 0 the wcs "to" and at index 1 the wcs "from" is expected |
Example
res = api.v1.part.updateTransformationByCSys({ id: 4, targets: [{ id: extrusion }], references: [15, 25] })
getExpression(param)
Returns the value and the expression
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: {
value: real|VOID,
expression: string
}|VOID, // object containing expression information
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the part to get the expression from |
param.name | string | name of the expression |
Example
res = api.v1.part.getExpression({ id: 4, name: 'height' })
updateExpression(param)
Updates an existing expressions in different products
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: boolean // true if everything is fine, if updating model caused an error false is returned
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | Array<object> | object or objects containing the parameters |
param.id | string | real | id | id or identifier of the product where the expressions wanted to be updated |
[param.toUpdate] | Array<object> | array of expressions to be updated |
param.toUpdate.name | string | name of the expression to update |
param.toUpdate.value | real | string | value of to update expression |
Example
res = api.v1.part.updateExpression({ id: 4, toUpdate: [{ name: 'lenght', value: 40 }] })
deleteExpression(param)
Deletes expressions in different products
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: boolean // true if everything is fine, false if deletion was not successful
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | Array<object> | object or objects containing the parameters |
param.id | string | real | id | id or identifier of the product where the expressions wanted to be deleted |
[param.toDelete] | Array<string> | array with names of expressions to be deleted |
Example
res = api.v1.part.deleteExpression({ id: 4, toDelete: ['width', 'size'] })
sketch(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.part 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 | 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 |
Example
res = api.v1.part.sketch({ id: 4 })
res = api.v1.part.sketch({ id: 4, planeId: 58 })
getSketchRegion(param)
Returns the id of the sketch region with the given name from the given part or instance.
Kind: v1.part 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
}
Param | Type | Description |
---|---|---|
param | object | object containing all the parameters |
param.id | string | real | id | id of the part or instance to get the sketch region from |
param.name | string | the name of the object to look for |
Example
res = api.v1.part.getSketchRegion({ id: 4, name: 'SketchRegion_Left' })
deleteSketch(param)
Deletes existing sketches
Kind: v1.part 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
res = api.v1.part.deleteSketch({ ids: [15, 36] })
calculateMassProperties(param)
Calculates the center of gravity (cog) and the volume of the given object. Depending on the input parameter the calculations were made on a single solid, a part, a subassembly, the whole model, ... E.g. the center of gravity of a root assembly, will be the sum of all solid's center of gravity over the whole assembly structure. If a solid is given, the center of gravity will be local to its part.
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: { cog: point, volume: real } | VOID // object containing the center of gravity and the volume
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the object to get the mass properties from |
Example
res = api.v1.part.calculateMassProperties({ id: 91 })
deleteFeature(param)
Deletes existing features
Kind: v1.part 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 features to delete |
Example
res = api.v1.part.deleteFeature({ ids: [15] })
getGeometryIds(param)
Returns the geometry (brep element like line, arc, plane,...) which best fits the given points
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: { points: id[], lines: id[], arcs: id[], circles: id[], nurbsCurves: id[], planes: id[], cylinders: id[],
cones: id[], spheres: id[], nurbsSurfaces: id[] } // object containing found geometries in the order of input
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.id | string | real | id | id of the part to look for the brep element |
[param.points] | Array<object> | array of objects containing the position to look for a point/vertex |
param.points[].pos | point | exact position of the point/vertex |
[param.lines] | Array<object> | array of objects containing the position to look for a line/edge |
param.lines[].pos | point | position on the line/edge |
[param.arcs] | Array<object> | array of objects containing the position to look for a arc/edge |
param.arcs[].pos | point | position on the arc/edge |
[param.circles] | Array<object> | array of objects containing the position to look for a circle/edge |
param.circles[].pos | point | position on the circle/edge or on the plane the circle is surrounding |
[param.nurbsCurves] | Array<object> | array of objects containing the position to look for a nurbsCurve/edge |
param.nurbsCurves[].pos | point | position on the nurbsCurve/edge |
[param.planes] | Array<object> | array of objects containing the positions to look for a plane/surface |
param.planes[].positions | Array<point> | position on the plane or multiple positions of midpoints of adjacent edges |
[param.cylinders] | Array<object> | array of objects containing the positions to look for a cylindrical plane/surface |
param.cylinders[].positions | Array<point> | position on the plane or multiple positions of midpoints of adjacent edges |
[param.cones] | Array<object> | array of objects containing the positions to look for a conical plane/surface |
param.cones[].positions | Array<point> | position on the plane or multiple positions of midpoints of adjacent edges |
[param.spheres] | Array<object> | array of objects containing the positions to look for a spherical plane/surface |
param.spheres[].positions | Array<point> | position on the plane or multiple positions of midpoints of adjacent edges |
[param.nurbsSurfaces] | Array<object> | array of objects containing the positions to look for a nurbs plane/surface |
param.nurbsSurfaces[].positions | Array<point> | position on the plane or multiple positions of midpoints of adjacent edges |
Example
res = api.v1.part.getGeometryIds({
id: 4,
planes: [
{
positions: [
[0, 50, 100],
[0, 100, 100],
],
},
],
})
getGeometryPositions(param)
Returns the positions which uniquely identifying the geometries (brep element like line, arc, plane,...)
- for faces (plane, cylindrical, spherical): it returns the midpoints of the adjacent edges of the face
- for edges, arcs, circles: it returns the midpoint
- for vertices: it returns the point of vertex
Kind: v1.part function
Returns: object
- object containing result and optional messages
{
result: Array<{ id: number, positions: point[] }> // array of objects containing the positions which have been found for given id
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
param.elems | Array<(string|real|id)> | brep elements to get indicating points from |
Example
res = api.v1.geometry.getGeometryPositions({ elems: [15, 89] })