Defines a group of model elements.
Direct children of an assembly are always instances which can refer to nested sub-assemblies, parts, or any other referenced model element already wrapped into an instance.
new Assembly(
name?):Assembly
Creates a model element with an optional name.
string | null
Name assigned to the model element.
Assembly
material:
VisualMaterial|null=null
Visual material assigned to the model element.
The default value is null.
get id():
bigint
Returns the unique identifier of the object.
bigint
get instances():
ReadonlySet<Instance>
Returns the direct child instances.
ReadonlySet<Instance>
get name():
string|null
Name of the model element.
The default value is null.
string | null
set name(
name):void
Sets the name of the model element.
string | null
Model element name.
void
get numberOfInstances():
number
Returns the number of direct child instances.
Use Assembly.instances and instances.size instead.
number
get uuid():
`${string}-${string}-${string}-${string}-${string}`|null
UUID of the model element.
The default value is null.
`${string}-${string}-${string}-${string}-${string}` | null
set uuid(
uuid):void
Sets the UUID of the model element.
`${string}-${string}-${string}-${string}-${string}` | null
Model element UUID.
void
accept(
visitor):void
Accepts an element visitor.
First enters the assembly by calling visitAssemblyEnter(). If it returns true, all child instances are visited. The assembly is then left by calling visitAssemblyLeave().
Visitor to accept.
void
Adds a child model element to the assembly.
Assemblies may only have instances as direct children. If element is not an instance, an interim instance is created which refers to it.
Parts and assemblies may be added to multiple assemblies to be shared. However, they should be referred to by unique instances when added to parent assemblies. Reusing the same instance in multiple parents creates an invalid model object with undefined subsequent behavior.
Model element or instance to add.
Transformation assigned to the created instance when element is not an instance.
Name assigned to the created instance when element is not an instance.
addInstance(
element):Instance
Adds an instance as a direct child of the assembly.
If element is already present in the assembly, it is not added again.
Instance to add.
addInstance(
element,transformation?,instanceName?):Instance
Adds a part or sub-assembly to the assembly.
Assemblies may only have instances as direct children. Therefore, a new interim instance is created which refers to element.
Parts and assemblies may be added to multiple assemblies to be shared. However, they should be referred to by unique instances when added to parent assemblies. Reusing the same instance in multiple parents creates an invalid model object with undefined subsequent behavior.
Part | Assembly
Part or assembly to add.
Transformation | null
Transformation assigned to the created instance.
string | null
Name assigned to the created instance.
removeInstance(
instance):boolean
Removes an instance from the assembly.
Instance to remove.
boolean