Defines an occurrence of part or assembly in a scene graph.
Instance contains a reference to another element part or assembly and is used to share data, e.g. two instances can share the same part adding own transformations.
new Instance(
reference?,transformation?,name?):Instance
Referenced element.
Part | Assembly | Instance | null
Transformation of the referenced element.
Transformation | null
Name of the instance.
string | null
Instance
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 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 reference():
ModelElement|null
Returns the referenced object. null if the instance does not refer to any object (by default).
ModelElement | null
set reference(
reference):void
Sets referenced object.
reference represents part or assembly or null, then sets its as this object reference.reference represents instance, then sets its reference as this object reference.Referenced object.
ModelElement | null
void
get transformation():
Transformation
Returns the transformation matrix.
If the matrix has not been explicitly assigned, then creates and explicitly assigns an identity matrix.
set transformation(
transformation):void
Sets transformation matrix.
Transformation matrix.
void
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 instance by calling visitInstanceEnter(). If it returns true then visits the referred element. Then leaves the instance calling visitInstanceLeave()
Accepted visitor.
void
hasTransformation():
boolean
Returns true if the instance has an explicitly attached transformation matrix, false otherwise.
boolean