Provides Manufacturing Toolkit (MTK) data model.
The model encapsulates a scene graph of model elements and is thus an entry point to the entire 3D model data.
The model may also contain associated drawing data.
new Model(
name?):Model
Creates a model with an optional name.
string | null
Name assigned to the model.
Model
drawing:
Drawing|null=null
Drawing data associated with the model.
The default value is null.
get id():
bigint
Returns the unique identifier of the object.
bigint
get name():
string|null
Name of the model.
The default value is null.
string | null
set name(
name):void
Sets the name of the model.
string | null
Model name.
void
get numberOfRoots():
number
Returns the number of root elements in the model.
Use Model.roots and roots.size instead.
number
get roots():
ReadonlySet<ModelElement>
Root elements currently stored in the model.
ReadonlySet<ModelElement>
accept(
visitor):void
Accepts an element visitor for all root elements.
See also ModelElement.accept.
Visitor to accept.
void
addRoot(
root):void
Adds a root element to the model.
If root is an instance, a new root assembly is created and the instance is added to it. Any other model element is added as a root directly.
The root element.
void
assignUuids():
this
Assigns fresh random UUIDs to model elements and associated drawing entities.
Each unique model element receives a single UUID even if it is reached multiple times through different instances. If drawing data is present, sheets, views, layers, drawing elements, and hatch contours also receive fresh UUIDs.
this
clear():
this
Clears the contents of the model while preserving its assigned name.
this
isEmpty():
boolean
Returns whether the model contains no root elements.
boolean
merge(
model):this
Merges another model into this model.
model to this model.Model
Model to merge.
this
open(
filename,dataProvider):Promise<boolean>
Reads an MTKWEB model into this model.
string
Name of the MTKWEB file.
Provider used to load data stored in external files.
Promise<boolean>