Class: Model

Model

The class representing the geometry data that was extracted from the file or assembly. Geometry data is a description of view. For example, for dwg it is a Model space or layout, and for rvt files it is a 3Dview.


new Model(impl, file)

Parameters:
Name Type Description
impl ModelImpl

An object that implements model data storage and server requests.

file File | Assembly

The File of 'Assembly' instance from which the geometry was extracted.

Members


<readonly> assembly :Assembly

The Assembly instance from which the geometry was extracted.

Type:

<readonly> data :Object

Raw model data received from the server.

Type:
  • Object

<readonly> database :string

The geometry database resource ID. Use downloadResource() to download model geometry database.

Type:
  • string

<readonly> default :boolean

true if this is default model.

Type:
  • boolean

<readonly> file :File

The File instance from which the geometry was extracted.

Type:

<readonly> fileId :string

The ID of the file from which the model was created.

Type:
  • string

<readonly> geometry :Array.<string>

The list of resource IDs for geometry data chinks. Use downloadResource() to download model geometry data.

Type:
  • Array.<string>

<readonly> id :string

Unique model ID.

Type:
  • string

<readonly> name :string

Model name.

Type:
  • string

Methods


<async> deleteViewpoint(guid)

Delete model viewpoint.

Note: Assemblу models do not support viewpoints.

Parameters:
Name Type Description
guid string

Viewpoint GUID.

Returns:
  • Returns the raw data of a deleted viewpoint.
Type
Promise.<Object>

<async> downloadResource(resourceId, onProgress, signal)

Downloads model resource, such as geometry database or geometry data.

Parameters:
Name Type Description
resourceId string

Resource ID.

onProgress ProgressCallback

Download progress callback.

signal AbortSignal

An AbortSignal object instance. Allows to communicate with a fetch request and abort it if desired.

Returns:
Type
Promise.<ArrayBuffer>

<async> getReferences( [signal])

Returns a list of references to files used to extract file geometry data.

Parameters:
Name Type Argument Description
signal AbortSignal <optional>
Returns:
Type
Promise.<FileReferences>

<async> getSnapshot(guid)

Returns viewpoint preview image as Data URL.

Parameters:
Name Type Description
guid string

Viewpoint GIID.

Returns:
Type
Promise.<string>

<async> getSnapshotData(guid, bitmapGuid)

Returns snapshot data.

Parameters:
Name Type Description
guid string

Viewpoint GUID.

bitmapGuid string

Bitmap GUID.

Returns:
Type
Promise.<string>

<async> getViewpoints()

Returns model viewpoint list.

Note: Assemblу models do not support viewpoints.

Returns:
Type
Promise.<Array.<Object>>

<async> saveViewpoint(viewpoint)

Add new model viewpoint. To create a new viewpoint use Viewer.createViewpoint().

Note: Assemblу models do not support viewpoints.

Parameters:
Name Type Description
viewpoint Object

Viewpoint.

Returns:
Type
Promise.<Object>