Defines a group of model elements.
Direct children of assembly are always instances which can refer to nested sub-assemblies or parts.
new Assembly(
name?):Assembly
Name of the model element.
string | null
Assembly
material:
VisualMaterial|null=null
The model element material. null if the element has no material (by default).
get id():
bigint
Returns object id.
bigint
get instances():
ReadonlySet<Instance>
Returns a set of child instances.
ReadonlySet<Instance>
get name():
string|null
Returns name of the model element. null if the element has no name (by default).
string | null
set name(
name):void
Sets name of the model element.
Name of the model element.
string | null
void
get numberOfInstances():
number
Returns number of child instances.
Deprecated. Use instances.size instead.
number
get uuid():
`${string}-${string}-${string}-${string}-${string}`|null
Returns uuid of the model element. null if the element has no assigned uuid (by default).
`${string}-${string}-${string}-${string}-${string}` | null
set uuid(
uuid):void
Sets uui of the model element.
Uuid of the model element.
`${string}-${string}-${string}-${string}-${string}` | null
void
accept(
visitor):void
Accepts an element visitor.
First enters the assembly by calling visitAssemblyEnter(). If it returns true then visits all the assembly children. Then leaves the assembly calling visitAssemblyLeave().
Accepted visitor.
void
Adds a new child element into the assembly.
Assemblies may only have instances as direct children. If element is not an instance (i.e. is a part or an assembly) an interim instance is created which will refer to the element.
Parts and assemblies may be added to multiple assemblies to be shared. However they must be referred by unique instances when adding to parent assemblies, i.e. each instance may not be added as a child into more than one assembly. Otherwise this will create an invalid model object which undefined subsequent behavior.
Added part or assembly.
Transformation of the element.
Name of the element instance.
addInstance(
element):Instance
Adds a new child element into the assembly. If the instance already presents in this object children, it won't be added.
Added instance.
Added or already existed instance.
addInstance(
element,transformation?,instanceName?):Instance
Adds a new child element into the assembly.
Assemblies may only have instances as direct children. Thus an interim instance is created which will refer to the element.
Parts and assemblies may be added to multiple assemblies to be shared. However they must be referred by unique instances when adding to parent assemblies, i.e. each instance may not be added as a child into more than one assembly. Otherwise this will create an invalid model object which undefined subsequent behavior.
Added part or assembly.
Part | Assembly
Transformation of the element.
Transformation | null
Name of the element instance.
string | null
Newly created instance.
removeInstance(
instance):boolean
Removes specific instance from assembly. Returns true if instance was removed, false otherwise.
boolean