Assemblies
Components
Definition
The assembly is the geometric combination of all its components, taking into account their relative placement and orientation.
The components of the assembly are references to ByMe Products. They usually carry a geometric representation (3D BM3 or BMA assembly), except for some edge cases.
Assemblies are created and modified in Assembly Editor.
Using Parameters in Assemblies
The properties of each component (position, orientation, own parameters,...etc.) can be linked (or "bonded") to parameters and/or relations of the assembly: parametric assemblies.
Relations
Definition
In an assembly, relations are expressions used to compute dynamic values.
They take as their input in one or multiple parameters and/or other relations of the assembly.
The result of the evaluation of the expression can be assigned to components properties, output set properties as well as anchor points properties.
Unlike parameters, relations value cannot be overloaded, they are completely internal to it.
Type
The type is the type of the result of the expression.
Supported types are: number, integer, string, boolean.
Expressions
Expressions can be:
- simple mathematical operations, such as addition, subtraction, multiplication, division, ... etc.
example: (width / 2) + xLeftLegOffset
- more complex operations, by using the "Math" javaScript method.
example: -Math.cos(angleRad-Pi_2).
- ternary expressions, to introduce boolean conditions. The syntax to use is the following one:
condition? value_true: value_false
example n°1: (width > 600)? true: false
example n°2: (handlePosition === 0)? handleOffset: height - handleOffset
The user also has the possibility to fetch the value of a parameter of a component of the assembly. The syntax is the following one:
Component.parameter
example: the expression Front.depth fetches the "depth" value of the component named "Front" in the assembly.
To avoid a "null pointer exception" on this kind of expression, it is advisable to test for nullity:
(Front !== null)? Front.depth: 0