Assembly
partTemplate([param])
Creates a new part and adds it as template to the product container. This part can be used for assembly building.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the new part template
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 new part template |
Example
res = api.v1.assembly.partTemplate()
res = api.v1.assembly.partTemplate({ name: 'Part_152' })
instance(param)
Creates instances of products and adds them to root assembly, assembly instance or assembly template.
- If the owner is an instance in the expanded tree, its template in the assembly container will also be updated.
- If the owner is an assembly template, all instances of the template will also be updated
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created instances
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.productId | string | real | id | id or identifier of the product to instantiate | |
param.ownerId | string | real | id | id or identifier of the owner of to adding instance, owner can be root assembly, assembly instance or assembly template. | |
[param.transformation] | Array<point> | Array<Array<real>> | [0,0,0] | transformation [origin, x-Dir, y-Dir] of the instance in global coordinates (default=[0,0,0]) or a 4x4 matrix e.g. [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]] |
[param.name] | string | "Instance" | name for the instance |
[param.ident] | string | custom string identifier for the added instance. | |
[param.isLocal] | boolean | FALSE | flag to define whether the transformation is local to owner or global (default=FALSE). This flag gets important if instances are created and added in sub assemblies. In this case, you probably want to add the instance locally to its owner. |
Example
res = api.v1.assembly.instance({ productId: 25, ownerId: 12 })
res = api.v1.assembly.instance({ productId: 25, ownerId: 12, transformation: [{125,0,250},{1,0,0},{0,1,0}] })
res = api.v1.assembly.instance({ productId: 25, ownerId: 12, transformation: [[1,0,0,125],[0,1,0,0],[0,0,1,250],[0,0,0,1]] })
create([param])
Creates a new root assembly. This is the top level assembly.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the created root assembly
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 | "AssemblyRoot" | name for the root assembly |
[param.ident] | string | custom string identifier for the created root assembly |
Example
res = api.v1.assembly.create()
getPartTemplate([param])
Returns the part template with given name from part container. If name is empty, all parts from part container will be returned.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|Array<id> // id or ids of the found part templates
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
[param] | object | object containing all the parameters |
[param.name] | string | name of the part to look for |
Example
res = api.v1.assembly.getPartTemplate()
res = api.v1.assembly.getPartTemplate({ name: 'Part_125' })
linearPattern(param)
Creates a new linear pattern constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created linear pattern constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the linear pattern constraint in | |
[param.name] | string | "LinearPattern" | name for the linear pattern constraint |
param.instanceId | string | real | id | id of the instance to be copied | |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.dir1] | object | object containing the parameters for the first direction of the linear pattern | |
[param.dir1.count] | real | 1 | number of copies over the first direction (default=1) |
[param.dir1.distance] | real | 100 | distance between copies over the first direction (default=100) |
[param.mate2] | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.dir2] | object | object containing the parameters for the second direction of the linear pattern | |
[param.dir2.count] | real | 1 | number of copies over the second direction (default=1) |
[param.dir2.distance] | real | 100 | distance between copies over the second direction (default=100) |
Example
res = api.v1.assembly.linearPattern({ id: 12, instanceId: 112, mate1: { path: [135], csys: 70 } })
updateLinearPattern(param)
Updates an existing linear pattern constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated linear pattern constraints
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 of the linear pattern constraint to update |
[param.name] | string | name for the linear pattern constraint |
[param.instanceId] | string | real | id | id of the instance to be copied |
[param.mate1] | object | object containing the parameters for mate 1 |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.dir1] | object | object containing the parameters for the first direction of the linear pattern |
[param.dir1.count] | real | number of copies over the first direction |
[param.dir1.distance] | real | distance between copies over the first direction |
[param.mate2] | object | object containing the parameters for mate 2 |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.dir2] | object | object containing the parameters for the second direction of the linear pattern |
[param.dir2.count] | real | number of copies over the second direction |
[param.dir2.distance] | real | distance between copies over the second direction |
Example
res = api.v1.assembly.updateLinearPattern({ id: 12, instanceId: 112, dir1: { count: 4, distance: 150 } })
getLinearPattern(param)
Returns the linear pattern constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
instanceId: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2?: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
dir1: {
count: real,
distance: real
},
dir2: {
count: real,
distance: real
}
} | Array<{
id: id
instanceId: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2?: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
dir1: {
count: real,
distance: real
},
dir2: {
count: real,
distance: real
}
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getLinearPattern({ id: 111, name: 'LP1' })
getAssemblyTemplate([param])
Returns the assembly template with given name from assembly container. If name is empty, all assembly from assembly container will be returned.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|Array<id> // id or ids of the found assembly templates
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
[param] | object | object containing all the parameters |
[param.name] | string | name of the assembly to look for |
Example
res = api.v1.assembly.getAssemblyTemplate()
res = api.v1.assembly.getAssemblyTemplate({ name: 'Assembly_02' })
getInstance(param)
Returns a single, mutliple or all instances of an owner, depending on whether a name is given or not. The owner is the parent of the instance/instances we're looking for and can be a root assembly, another instance or an assembly template.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the found instances
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | Array<object> | object or objects containing all the parameters |
param.ownerId | string | real | id | id of the owner from which we are searching the children for instances that have the name we are looking for. |
[param.name] | string | name of the instance to look for |
Example
api.v1.assembly.getInstance({ ownerId: 5, name: 'Inst0' }) // return value = 10
api.v1.assembly.getInstance([
{ ownerId: 5, name: 'Inst0' },
{ ownerId: 5, name: 'Inst1' },
]) // return value = [10, 15]
api.v1.assembly.getInstance({ ownerId: 5 }) // return value = [10, 15, 20]
deleteInstance(param)
Deletes instances from root assembly, other instances or assembly templates.
Kind: v1.assembly 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 or identifiers of the instances to delete |
Example
res = api.v1.assembly.deleteInstance({ ids: [796, 852, 963] })
fastened(param)
Creates a new fastened constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created fastened constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the fastened constraint in | |
[param.name] | string | "Fastened" | name for the fastened constraint (default="Fastened") |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
param.mate2 | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate 2 (default="Z") |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.xOffset] | real | 0 | offset along x-axis from mate1 to mate2 (default=0) |
[param.yOffset] | real | 0 | offset along y-axis from mate1 to mate2 (default=0) |
[param.zOffset] | real | 0 | offset along z-axis from mate1 to mate2 (default=0) |
[param.xRotation] | real | 0 | rotation of mate2 in radians around x-axis of mate1 (default=0) |
[param.yRotation] | real | 0 | rotation of mate2 in radians around y-axis of mate1 (default=0) |
[param.zRotation] | real | 0 | rotation of mate2 in radians around z-axis of mate1 (default=0) |
[param.useCurrentTransform] | boolean | FALSE | a flag to ignore specified offsets / rotations and recalculate them according to mates' current transforms (default=FALSE) |
Example
res = api.v1.assembly.fastened({ id: 25, mate1: { path: [111], csys: 70 }, mate2: { path: [50], csys: 31 } })
updateFastened(param)
Updates an existing fastened constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated fastened constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the fastened constraint to update | |
[param.name] | string | name for the fastened constraint | |
[param.mate1] | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate | |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps | |
[param.mate2] | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate 2 | |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps | |
[param.xOffset] | real | offset along x-axis from mate1 to mate2 | |
[param.yOffset] | real | offset along y-axis from mate1 to mate2 | |
[param.zOffset] | real | offset along z-axis from mate1 to mate2 | |
[param.xRotation] | real | rotation of mate2 in radians around x-axis of mate1 | |
[param.yRotation] | real | rotation of mate2 in radians around y-axis of mate1 | |
[param.zRotation] | real | rotation of mate2 in radians around z-axis of mate1 | |
[param.useCurrentTransform] | boolean | FALSE | a flag to ignore specified offsets / rotations and recalculate them according to mates' current transforms (default=FALSE) |
Example
res = api.v1.assembly.updateFastened({ id: 36, mate1: { csys: 85 }, xOffset: 150 })
getFastened(param)
Returns the fastened constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
xOffset: real
yOffset: real
zOffset: real
xRotation: real
yRotation: real
zRotation: real
} | Array<{
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
xOffset: real
yOffset: real
zOffset: real
xRotation: real
yRotation: real
zRotation: real
} | VOID> | VOID
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 of the assembly or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getFastened({ id: 25, name: 'Fastened3' })
getFastenedOrigin(param)
Returns the fastened origin constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
xOffset: real
yOffset: real
zOffset: real
xRotation: real
yRotation: real
zRotation: real
} | Array<{
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
xOffset: real
yOffset: real
zOffset: real
xRotation: real
yRotation: real
zRotation: real
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getFastenedOrigin({ id: 25, name: 'FO_5' })
fastenedOrigin(param)
Creates a new fastened origin constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created fastened origin constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the fastened origin constraint in | |
[param.name] | string | "FastenedOrigin" | name for the fastened origin constraint (default="FastenedOrigin") |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.xOffset] | real | 0 | offset along x-axis from mate1 to global origin (default=0) |
[param.yOffset] | real | 0 | offset along y-axis from mate1 to global origin (default=0) |
[param.zOffset] | real | 0 | offset along z-axis from mate1 to global origin (default=0) |
[param.xRotation] | real | 0 | rotation of mate2 in radians around x-axis of global origin (default=0) |
[param.yRotation] | real | 0 | rotation of mate2 in radians around y-axis of global origin (default=0) |
[param.zRotation] | real | 0 | rotation of mate2 in radians around z-axis of global origin (default=0) |
[param.useCurrentTransform] | real | FALSE | a flag to ignore specified offsets / rotations and recalculate them according to mates' current transforms (default=FALSE) |
Example
res = api.v1.assembly.fastenedOrigin({ id: 796, mate1: { path: [111], csys: 70, flip: "-X" }, xRotation: C:PI })
updateFastenedOrigin(param)
Updates an existing fastened origin constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created fastened origin constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the fastened origin constraint to update | |
[param.name] | string | name for the fastened origin constraint | |
[param.mate1] | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate | |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps | |
[param.xOffset] | real | offset along x-axis from mate1 to global origin (default=0) | |
[param.yOffset] | real | offset along y-axis from mate1 to global origin (default=0) | |
[param.zOffset] | real | offset along z-axis from mate1 to global origin (default=0) | |
[param.xRotation] | real | rotation of mate2 in radians around x-axis of global origin (default=0) | |
[param.yRotation] | real | rotation of mate2 in radians around y-axis of global origin (default=0) | |
[param.zRotation] | real | rotation of mate2 in radians around z-axis of global origin (default=0) | |
[param.useCurrentTransform] | boolean | FALSE | a flag to ignore specified offsets / rotations and recalculate them according to mates' current transforms (default=FALSE) |
Example
res = api.v1.assembly.updateFastenedOrigin({ id: 52, xOffset: 150, zOffset: 58 })
revolute(param)
Creates a new revolute constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created revolute constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the revolute constraint in | |
[param.name] | string | "Revolute" | name for the revolute constraint (default="Revolute") |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
param.mate2 | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate 2 (default="Z") |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.zOffset] | real | 0 | offset along z-axis from mate1 to mate2 (default=0) |
[param.zRotationLimits] | object | VOID | object defining min and max value of rotation around z-axis | |
param.zRotationLimits.min | real | VOID | min value of rotation around z-axis in radians | |
param.zRotationLimits.max | real | VOID | max value of rotation around z-axis in radians |
Example
res = api.v1.assembly.revolute({ id: 25, mate1: { path: [111], csys: 70 }, mate2: { path: [50], csys: 31 } })
updateRevolute(param)
Updates a revolute constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated revolute constraints
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 of the revolute constraint to update |
[param.name] | string | name for the revolute constraint |
[param.mate1] | object | object containing the parameters for mate 1 |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.mate2] | object | object containing the parameters for mate 2 |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate 2 |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.zOffset] | real | offset along z-axis from mate1 to mate2 |
[param.zRotationLimits] | object | VOID | object defining min and max value of rotation around z-axis |
param.zRotationLimits.min | real | VOID | min value of rotation around z-axis in radians |
param.zRotationLimits.max | real | VOID | max value of rotation around z-axis in radians |
Example
res = api.v1.assembly.updateRevolute({ id: 25, mate2: { flip: '-Z' } })
getRevolute(param)
Returns the revolute constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
zOffset: real
zRotationLimits: {
min: real, max: real
}
} | Array<{
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
zOffset: real
zRotationLimits: {
min: real, max: real
}
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getRevolute({ id: 25, name: 'Rev_12' })
circularPattern(param)
Creates a new circular pattern constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created circular pattern constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the circular pattern constraint in | |
[param.name] | string | "CircularPattern" | name for the circular pattern constraint (default="CircularPattern") |
param.instanceId | string | real | id | id of the instance to be copied | |
param.mate1 | object | object containing the parameters for this mate | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.instanceCount] | real | 1 | number of copies (default=1) |
[param.angle] | real | 0 | angle in radians between copies (default=0) |
[param.offset] | real | 0 | offset over the rotational axis between copies (default=0) |
Example
res = api.v1.assembly.circularPattern({ id: 96, instanceId: 15, mate1: { path: [111], csys: 70 }, instanceCount: 4, angle: 90g })
updateCircularPattern(param)
Updates an existing circular pattern constraint. If optional parameters are not set, the feature will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated circular pattern constraints
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 of the circular pattern constraint to update |
[param.name] | string | name for the circular pattern constraint |
[param.instanceId] | string | real | id | id of the instance to be copied |
[param.mate1] | object | object containing the parameters for this mate |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this mate |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.instanceCount] | real | number of copies |
[param.angle] | real | angle in radians between copies |
[param.offset] | real | offset over the rotational axis between copies |
Example
res = api.v1.assembly.updateCircularPattern({ id: 108, instanceCount: 3, angle: 120g })
cylindrical(param)
Creates a new cylindrical constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created cylindrical constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the cylindrical constraint in | |
[param.name] | string | "Cylindrical" | name for the cylindrical constraint (default="Cylindrical") |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
param.mate2 | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate 2 (default="Z") |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.zOffsetLimits] | object | VOID | object defining min and max value of the offset around z-axis | |
param.zOffsetLimits.min | real | VOID | min value of the offset along z-axis | |
param.zOffsetLimits.max | real | VOID | max value value of the offset along z-axis | |
[param.zRotationLimits] | object | VOID | object defining min and max value of rotation around z-axis | |
param.zRotationLimits.min | real | VOID | min value of rotation around z-axis in radians | |
param.zRotationLimits.max | real | VOID | max value of rotation around z-axis in radians |
Example
res = api.v1.assembly.cylindrical({ id: 108, mate1: { path: [111], csys: 70 }, mate2: { path: [113], csys: 70 } })
updateCylindrical(param)
Updates an existing cylindrical constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated cylindrical constraints
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 of the cylindrical constraint to update |
[param.name] | string | name for the cylindrical constraint |
[param.mate1] | object | object containing the parameters for mate 1 |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.mate2] | object | object containing the parameters for mate 2 |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate 2 |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.zOffsetLimits] | object | VOID | object defining min and max value of the offset around z-axis |
param.zOffsetLimits.min | real | VOID | min value of the offset along z-axis |
param.zOffsetLimits.max | real | VOID | max value value of the offset along z-axis |
[param.zRotationLimits] | object | VOID | object defining min and max value of rotation around z-axis |
param.zRotationLimits.min | real | VOID | min value of rotation around z-axis in radians |
param.zRotationLimits.max | real | VOID | max value of rotation around z-axis in radians |
Example
res = api.v1.assembly.updateCylindrical({ id: 120, zRotationLimits: { min: 0, max: 90g } })
parallel(param)
Creates a new parallel constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created parallel constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the parallel constraint in | |
[param.name] | string | "Parallel" | name for the parallel constraint (default="Parallel") |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
param.mate2 | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate 2 (default="Z") |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.xOffsetLimits] | object | VOID | object defining min and max value of the offset around x-axis | |
[param.xOffsetLimits.min] | real | VOID | min value of the offset along x-axis | |
[param.xOffsetLimits.max] | real | VOID | max value value of the offset along x-axis | |
[param.yOffsetLimits] | object | VOID | object defining min and max value of the offset around y-axis | |
[param.yOffsetLimits.min] | real | VOID | min value of the offset along y-axis | |
[param.yOffsetLimits.max] | real | VOID | max value value of the offset along y-axis | |
[param.zOffsetLimits] | object | VOID | object defining min and max value of the offset around z-axis | |
[param.zOffsetLimits.min] | real | VOID | min value of the offset along z-axis | |
[param.zOffsetLimits.max] | real | VOID | max value value of the offset along z-axis | |
[param.zRotationLimits] | object | VOID | object defining min and max value of rotation around z-axis | |
[param.zRotationLimits.min] | real | VOID | min value of rotation around z-axis in radians | |
[param.zRotationLimits.max] | real | VOID | max value of rotation around z-axis in radians |
Example
res = api.v1.assembly.parallel({ id: 108, mate1: { path: [111], csys: 70 }, mate2: { path: [113], csys: 70 } })
updateParallel(param)
Updates an existing parallel constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated parallel constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the parallel constraint to update | |
[param.name] | string | name for the parallel constraint | |
[param.mate1] | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate | |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps |
[param.mate2] | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate 2 | |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps | |
[param.xOffsetLimits] | object | VOID | object defining min and max value of the offset around x-axis | |
[param.xOffsetLimits.min] | real | VOID | min value of the offset along x-axis | |
[param.xOffsetLimits.max] | real | VOID | max value value of the offset along x-axis | |
[param.yOffsetLimits] | object | VOID | object defining min and max value of the offset around y-axis | |
[param.yOffsetLimits.min] | real | VOID | min value of the offset along y-axis | |
[param.yOffsetLimits.max] | real | VOID | max value value of the offset along y-axis | |
[param.zOffsetLimits] | object | VOID | object defining min and max value of the offset around z-axis | |
[param.zOffsetLimits.min] | real | VOID | min value of the offset along z-axis | |
[param.zOffsetLimits.max] | real | VOID | max value value of the offset along z-axis | |
[param.zRotationLimits] | object | VOID | object defining min and max value of rotation around z-axis | |
[param.zRotationLimits.min] | real | VOID | min value of rotation around z-axis in radians | |
[param.zRotationLimits.max] | real | VOID | max value of rotation around z-axis in radians |
Example
res = api.v1.assembly.updateParallel({ id: 108, zRotationLimits: { min: 0, max: 90g } })
planar(param)
Creates a new planar constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created planar constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the planar constraint in | |
[param.name] | string | "Planar" | name for the planar constraint (default="Planar") |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
param.mate2 | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the main axis of the mate 2 (default="Z") |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.zOffset] | real | 0 | offset along z-axis from mate1 to mate2 (default=0) |
[param.xOffsetLimits] | object | VOID | object defining min and max value of the offset around x-axis | |
param.xOffsetLimits.min | real | VOID | min value of the offset along x-axis | |
param.xOffsetLimits.max | real | VOID | max value value of the offset along x-axis | |
[param.yOffsetLimits] | object | VOID | object defining min and max value of the offset around y-axis | |
param.yOffsetLimits.min | real | VOID | min value of the offset along y-axis | |
param.yOffsetLimits.max | real | VOID | max value value of the offset along y-axis | |
[param.zRotationLimits] | object | VOID | object defining min and max value of rotation around z-axis | |
param.zRotationLimits.min | real | VOID | min value of rotation around z-axis in radians | |
param.zRotationLimits.max | real | VOID | max value of rotation around z-axis in radians |
Example
res = api.v1.assembly.planar({ id: 108, mate1: { path: [111], csys: 70 }, mate2: { path: [113], csys: 70 } })
updatePlanar(param)
Updates an existing planar constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated planar constraints
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 of the planar constraint to update |
[param.name] | string | name for the planar constraint |
[param.mate1] | object | object containing the parameters for mate 1 |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.mate2] | object | object containing the parameters for mate 2 |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the main axis of the mate 2 |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.zOffset] | real | offset along z-axis from mate1 to mate2 |
[param.xOffsetLimits] | object | VOID | object defining min and max value of the offset around x-axis |
param.xOffsetLimits.min | real | VOID | min value of the offset along x-axis |
param.xOffsetLimits.max | real | VOID | max value value of the offset along x-axis |
[param.yOffsetLimits] | object | VOID | object defining min and max value of the offset around y-axis |
param.yOffsetLimits.min | real | VOID | min value of the offset along y-axis |
param.yOffsetLimits.max | real | VOID | max value value of the offset along y-axis |
[param.zRotationLimits] | object | VOID | object defining min and max value of rotation around z-axis |
param.zRotationLimits.min | real | VOID | min value of rotation around z-axis in radians |
param.zRotationLimits.max | real | VOID | max value of rotation around z-axis in radians |
Example
res = api.v1.assembly.updatePlanar({ id: 108, zOffsetLimits: { min: 0, max: 150 } })
slider(param)
Creates a new slider constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created slider constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the slider constraint in | |
[param.name] | string | "Slider" | name for the slider constraint (default="Slider") |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
param.mate2 | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate 2 (default="Z") |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.xOffset] | real | 0 | offset along x-axis from mate1 to mate2 (default=0) |
[param.yOffset] | real | 0 | offset along y-axis from mate1 to mate2 (default=0) |
[param.zOffsetLimits] | object | VOID | object defining min and max value of the offset around z-axis | |
param.zOffsetLimits.min | real | VOID | min value of the offset along z-axis | |
param.zOffsetLimits.max | real | VOID | max value value of the offset along z-axis |
Example
res = api.v1.assembly.slider({ id: 108, mate1: { path: [111], csys: 70 }, mate2: { path: [113], csys: 70 } })
updateSlider(param)
Updates an existing slider constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated slider constraints
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 of the slider constraint to update |
[param.name] | string | name for the slider constraint |
[param.mate1] | object | object containing the parameters for mate 1 |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.mate2] | object | object containing the parameters for mate 2 |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate 2 |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.xOffset] | real | offset along x-axis from mate1 to mate2 |
[param.yOffset] | real | offset along y-axis from mate1 to mate2 |
[param.zOffsetLimits] | object | VOID | object defining min and max value of the offset around z-axis |
param.zOffsetLimits.min | real | VOID | min value of the offset along z-axis |
param.zOffsetLimits.max | real | VOID | max value value of the offset along z-axis |
Example
res = api.v1.assembly.updateSlider({ id: 108, mate1: { path: [111], csys: 70 }, mate2: { path: [113], csys: 70 } })
getCircularPattern(param)
Returns the circular pattern constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
instanceId: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
instanceCount: real
angle: real
offset: real
} | Array<{
id: id
instanceId: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
instanceCount: real
angle: real
offset: real
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getCircularPattern({ id: 111, name: 'CP1' })
getSlider(param)
Returns the slider constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
xOffset: real
yOffset: real
zOffsetLimits: {
min: real, max: real
}
} | Array<{
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
xOffset: real
yOffset: real
zOffsetLimits: {
min: real, max: real
}
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getSlider({ id: 111, name: 'Slider_2' })
getParallel(param)
Returns the parallel constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
xOffsetLimits: {
min: real, max: real
}
yOffsetLimits: {
min: real, max: real
}
zOffsetLimits: {
min: real, max: real
}
zRotationLimits: {
min: real, max: real
}
} | Array<{
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
xOffsetLimits: {
min: real, max: real
}
yOffsetLimits: {
min: real, max: real
}
zOffsetLimits: {
min: real, max: real
}
zRotationLimits: {
min: real, max: real
}
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getParallel({ id: 111, name: 'Parallel_12' })
getPlanar(param)
Returns the planar constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
zOffset: real
xOffsetLimits: {
min: real, max: real
}
yOffsetLimits: {
min: real, max: real
}
zRotationLimits: {
min: real, max: real
}
} | Array<{
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
zOffset: real
xOffsetLimits: {
min: real, max: real
}
yOffsetLimits: {
min: real, max: real
}
zRotationLimits: {
min: real, max: real
}
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getPlanar({ id: 111, name: 'Planar' })
getCylindrical(param)
Returns the cylindrical constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
zOffsetLimits: {
min: real, max: real
}
zRotationLimits: {
min: real, max: real
}
} | Array<{
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
zOffsetLimits: {
min: real, max: real
}
zRotationLimits: {
min: real, max: real
}
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getCylindrical({ id: 111, name: 'Cylindrical' })
update3DConstraintValue(param)
Updates multiple limited values of constraints
Kind: v1.assembly 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 | Array<object> | object or objects containing the parameters |
param.id | string | real | id | id of the constraint to update a value |
param.name | "X_OFFSET" | "Y_OFFSET" | "Z_OFFSET" | "Z_ROTATION" | name of the param to update the value |
param.value | real | value to set for the given constraint value |
Example
res = api.v1.assembly.update3DConstraintValue({ id: 76, name: 'X_OFFSET', value: 50 })
convertToTemplate([param])
Converts the current root assembly into an assembly template and creates a new root assembly, where the new template can be used to create instances from.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
[param] | object | object containing the parameters | |
[param.name] | string | "Subassembly" | name of the new converted template (default="Subassembly") |
Example
res = api.v1.assembly.convertToTemplate()
exportNode(param)
Exports a node from the assembly tree or a template from containers. A node can be any instance (part or assembly) in the tree. A template can be a part or assembly, doesn't matter if it has already been instantiated or not. In any case, if the node or template is a part, the root of the created file is a part. In case of the node or template is an assembly, the root of the created file is a root assembly. By default the model is written to a data string.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
success: boolean,
content?: string // content is the data string of the export and is only available if neither file nor url is defined.
}
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 node or template to export |
param.format | "OFB" | "STP" | type of file to export the node or template as |
[param.file] | string | full path of the file. Path has to be a for the ClassCAD process reachable local or UNC path. |
[param.url] | string | url to send the model data to. |
[param.encoding] | "base64" | the encoding the data will be encoded with. If compression is also set, the decoding happens after compression! |
[param.compression] | "deflate" | the compression algorithm the data is compressed with. |
Example
res = api.v1.assembly.exportNode({ id: 125, format: 'STP' })
finishMovingUnderConstraints(param)
Finishes moving the constrained objects.
Kind: v1.assembly 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 assembly which contains the moved objects |
Example
res = api.v1.assembly.finishMovingUnderConstraints({ id: 796 })
moveUnderConstraints(param)
Attempts to move constrained objects.
Kind: v1.assembly 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 assembly which contains the moved objects |
param.rotation | object | object containing three consecutive rotation (basis) vectors |
param.rotation.xDir | point | basis vector containing the rotation around x-axis |
param.rotation.yDir | point | basis vector containing the rotation around y-axis |
param.rotation.zDir | point | basis vector containing the rotation around z-axis |
param.offset | point | vector containing the translation |
Example
res = api.v1.assembly.moveUnderConstraints({ id: 796, rotation: { xDir: [0,-1,0], yDir: [1,0,0], zDir: [0,0,1] })
res = api.v1.assembly.moveUnderConstraints({ id: 796, offset: [20,150,30] })
startMovingUnderConstraints(param)
Prepares to move constrained objects.
Kind: v1.assembly 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 assembly which contains the moved objects |
param.instanceIds | Array<(string|real|id)> | ids of the instances to be moved |
param.pivotInfo | point | this is the fixed point, where the object rotates around |
param.mucType | "TRANSLATION_1D" | "TRANSLATION_2D" | "ROTATION" | type of transformation |
Example
res = api.v1.assembly.startMovingUnderConstraints({
id: 796,
instanceIds: [handleInst1],
pivotInfo: [50, 50, 20],
mucType: 'ROTATION',
})
transformInstance(param)
Transforms instances by the given transformation.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: VOID
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id or identifier of the instance to transform | |
param.transformation | Array<point> | transformation [origin, x-Dir, y-Dir] of the instance in global coordinates | |
[param.isLocal] | boolean | FALSE | boolean flag to define whether the transformation is local to owner or global(default=FALSE) |
Example
res = api.v1.assembly.transformInstance({
id: 150,
transformation: [
[-10, -10, 0],
[1, 0, 0],
[0, 1, 0],
],
})
loadProduct(param)
Loads a product from file, data or url.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: { id: string|real|id } | VOID // object containing id of the loaded product
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing the parameters |
[param.url] | string | url to load product 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 load |
[param.encoding] | "base64" | the encoding the data is encoded with. If compression is also set, the decoding happens first! |
[param.compression] | "deflate" | the compression algorithm the data is compressed with. |
[param.format] | "OFB" | "STP" | content format of to load product |
[param.ident] | string | custom string identifier for the loaded product. |
Example
res = api.v1.assembly.loadProduct({ file: '/var/models/file.stp' })
res = api.v1.assembly.loadProduct({ url: 'https://.../file.ofb', format: 'OFB' })
res = api.v1.assembly.loadProduct({ data: 'abc123', format: 'OFB' })
setCurrentInstance(param)
Sets the given instance as the current. The current product will also be set to the current instance's product template. TODO: Description of the LGS3D context? The constraint context for this instance will be solved?
Kind: v1.assembly 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 | Array<object> | object or objects containing the parameters |
param.id | string | real | id | id of the instance to set as the current one |
Example
res = api.v1.assembly.setCurrentInstance({ id: 796 })
setIdent(param)
Sets a string identifier for an existing object
Kind: v1.assembly 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 | Array<object> | object or objects containing the parameters |
param.id | string | real | id | id of the object to set an identifier on |
param.ident | string | identifier for the given object. Must be unique. |
Example
res = api.v1.assembly.setIdent({ id: 796, ident: 'ident_526' })
gear(param)
Creates a new gear relation. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created gear relations
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the gear relation in | |
[param.name] | string | "GearRelation" | name for the gear relation (default="GearRelation") |
param.constr1Id | string | real | id | id of the first constraint of the relation | |
param.constr2Id | string | real | id | id of the second constraint of the relation | |
[param.ratio] | real | 1 | ratio value of rotational velocity (d(constr2.zRotationValue) / d(constr1.zRotationValue)) (default=1) |
[param.offset] | real | 0 | offset value of the second mate angle in radians (default=0) |
Example
res = api.v1.assembly.gear({ id: 796, constr1Id: 50, constr2Id: 56, ratio: 0.5 })
updateGear(param)
Updates an existing gear relation. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated gear relations
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 of the gear relation to update |
[param.name] | string | name for the gear relation |
[param.constr1Id] | string | real | id | id of the first constraint of the relation |
[param.constr2Id] | string | real | id | id of the second constraint of the relation |
[param.ratio] | real | ratio value of rotational velocity (d(constr2.zRotationValue) / d(constr1.zRotationValue)) |
[param.offset] | real | offset value of the second mate angle in radians |
Example
res = api.v1.assembly.updateGear({ id: 50, offset: 1.57 })
group(param)
Creates a new group constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created group constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the gear relation in | |
[param.name] | string | "Group" | name for the group constraint (default="Group") |
param.instanceIds | string | real | id | ids of the instances to group |
Example
res = api.v1.assembly.group({ id: 796, instanceIds: [114, 125, 129] })
updateGroup(param)
Updates an existing group constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated group constraints
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 of the group constraint to update |
[param.name] | string | name for the group constraint |
[param.instanceIds] | string | real | id | ids of the instances to group |
Example
res = api.v1.assembly.updateGroup({ id: 56, instanceIds: [114, 129] })
assemblyTemplate([param])
Creates a new assembly and adds it as template to the product container. This assembly can be used for assembly building.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the new assembly template
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 | "Assembly" | name of the new assembly template (default="Assembly") |
Example
res = api.v1.assembly.assemblyTemplate()
from(param)
Creates an assembly from a json defined assembly or an ecxml definition.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID // id of the created root assembly
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Description |
---|---|---|
param | object | object containing all the parameters |
[param.url] | string | url to load 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 to load from |
[param.format] | "JSON" | "XML" | "ECXML" | content format of to load from, has to be passed if load from stream or url |
Example
res = api.v1.assembly.from({ file: '/var/models/file.ecxml', format: 'ECXML' })
res = api.v1.assembly.from({ url: 'https://.../file.ofb', format: 'ECXML' })
res = api.v1.assembly.from({ data: 'abc123', format: 'JSON' })
getSpherical(param)
Returns the spherical constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
yRotationLimits: {
min: real, max: real
}
} | Array<{
id: id
name: string
mate1: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
mate2: {
path: id[],
csys: id,
flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z",
reorient: "0" | "90" | "180" | "270"
}
yRotationLimits: {
min: real, max: real
}
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getSpherical({ id: 111, name: 'Spherical2' })
getGroup(param)
Returns the group constraint of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
instanceIds: id[]
name: string
} | Array<{
id: id
instanceIds: id[]
name: string
} | VOID> | VOID
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 of the product or instance to look for constraint |
param.name | string | the name of the constraint to look for |
Example
res = api.v1.assembly.getGroup({ id: 111, name: 'Group_Left' })
createUncommitedObject(param)
Attention: This method should only be used, if the intention is very clear. Creates a new uncommited (empty) object in the given assembly.
Kind: v1.assembly 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 assembly 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.assembly.createUncommitedObject({ id: 12, type: 'CC_FastenedConstraint', name: 'Fastened' })
getGear(param)
Returns the gear relation of given reference with specified name.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: {
id: id
name: string
constr1Id: id
constr2Id: id
ratio: real
offset: real
} | Array<{
id: id
name: string
constr1Id: id
constr2Id: id
ratio: real
offset: real
} | VOID> | VOID
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 of the product or instance to look for the relation |
param.name | string | the name of the relation to look for |
Example
res = api.v1.assembly.getGear({ id: 111, name: 'Gear_Left' })
spherical(param)
Creates a new spherical constraint. If optional parameters are not set, the default values will be used, see (default=xy).
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the created spherical constraints
messages?: { message: string, level: real, code: real, api: string }[]
maxLevel?: real
}
Param | Type | Default | Description |
---|---|---|---|
param | object | Array<object> | object or objects containing the parameters | |
param.id | string | real | id | id of the assembly to create the spherical constraint in | |
[param.name] | string | "Spherical" | name for the spherical constraint (default="Spherical") |
param.mate1 | object | object containing the parameters for mate 1 | |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array | |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate | |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate (default="Z") |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
param.mate2 | object | object containing the parameters for mate 2 | |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array | |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate | |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | "Z" | flip type which defines the global main axis of the mate 2 (default="Z") |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | "0" | orientation around the main axis in 90° steps (default="0") |
[param.yRotationLimits] | object | VOID | object defining min and max value of rotation around y-axis | |
param.yRotationLimits.min | real | VOID | min value of rotation around y-axis in radians | |
param.yRotationLimits.max | real | VOID | max value of rotation around y-axis in radians |
Example
res = api.v1.assembly.spherical({ id: 108, mate1: { path: [111], csys: 70 }, mate2: { path: [113], csys: 70 } })
updateSpherical(param)
Updates an existing spherical constraint. If optional parameters are not set, the constraint will keep the existing values.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id|VOID|Array<id|VOID> // id or ids of the updated spherical constraints
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 of the spherical constraint to update |
[param.name] | string | name for the spherical constraint |
[param.mate1] | object | object containing the parameters for mate 1 |
param.mate1.path | Array<(string|real|id)> | mate path to the first part as array |
param.mate1.csys | string | real | id | id of the work coordinate system to use for this first mate |
[param.mate1.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate |
[param.mate1.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.mate2] | object | object containing the parameters for mate 2 |
param.mate2.path | Array<(string|real|id)> | mate path to the second part as array |
param.mate2.csys | string | real | id | id of the work coordinate system to use for this second mate |
[param.mate2.flip] | "X" | "-X" | "Y" | "-Y" | "Z" | "-Z" | flip type which defines the global main axis of the mate 2 |
[param.mate2.reorient] | "0" | "90" | "180" | "270" | orientation around the main axis in 90° steps |
[param.yRotationLimits] | object | VOID | object defining min and max value of rotation around y-axis |
param.yRotationLimits.min | real | VOID | min value of rotation around y-axis in radians |
param.yRotationLimits.max | real | VOID | max value of rotation around y-axis in radians |
Example
res = api.v1.assembly.updateSpherical({ id: 108, mate1: { path: [111], csys: 70 } })
setCurrentProduct(param)
Sets the current product. The current product is exported in the save commando.
Kind: v1.assembly function
Returns: object
- object containing result and optional messages
{
result: id | VOID // id of the product which was the current one before calling this function
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 product to become the current one |
Example
res = api.v1.assembly.setCurrentProduct({ id: 796 })
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.assembly 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.assembly.calculateMassProperties({ id: 91 })
deleteTemplate(param)
Deletes a part or assembly template.
Kind: v1.assembly 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 templates to delete |
Example
res = api.v1.assembly.deleteTemplate({ ids: [796, 852, 963] })