Provides properties and methods for working with view of the file or assembly. For example, for dwg it is a Model space or layout, and for rvt files it is a 3D view.

Hierarchy (View Summary)

Constructors

  • Parameters

    • data: any

      Raw model data received from the server.

    • file: File | Assembly

      The file/assembly instance that owns the model.

    Returns Model

Properties

headers: HeadersInit

Endpoint-specific HTTP headers for the GET, POST, PUT and DELETE requests. You can add custom headers at any time.

path: string

Endpoint API path relative to the REST API server URL.

Accessors

  • get assembly(): Assembly
  • The Assembly instance that owns the model.

    Returns Assembly

  • get data(): any
  • Raw model data received from the server.

    Returns any

  • get database(): string
  • Scene description resource file name. Use downloadResource() to download scene description file.

    Returns string

  • get default(): boolean
  • true if this is default model.

    Returns boolean

  • get file(): File
  • The File instance that owns the model.

    Returns File

  • get fileId(): string
  • The ID of the file that owns the model.

    Returns string

  • get geometry(): string[]
  • The list of geometry data resource files. Use downloadResource() to download geometry data files.

    Returns string[]

  • get id(): string
  • Unique model ID.

    Returns string

  • get name(): string
  • Model name.

    Returns string

  • get type(): string
  • Model owner type, matches the file extension this is model of the file, or assembly for assemblies.

    Returns string

Methods

  • Deletes the specified viewpoint from the owner file/assembly.

    Parameters

    • guid: string

      Viewpoint GUID.

    Returns Promise<any>

    Returns the raw data of a deleted viewpoint.

  • Deprecated since 25.3. Use downloadResourceRange() instead.

    Parameters

    • requestId: number
    • records: any
    • dataId: string
    • OptionalonProgress: (progress: number, chunk: Uint8Array, requestId: number) => void
    • Optionalsignal: AbortSignal

    Returns Promise<void>

  • Downloads a resource file. Resource files are files that contain model scene descriptions, or geometry data.

    Parameters

    • dataId: string

      Resource file name.

    • OptionalonProgress: (progress: number, chunk: Uint8Array) => void

      Download progress callback.

    • Optionalsignal: AbortSignal

      An AbortController signal. Allows to communicate with a fetch request and abort it if desired.

    Returns Promise<ArrayBuffer>

  • Downloads a part of resource file. Resource files are files that contain model scene descriptions, or geometry data.

    Parameters

    • dataId: string

      Resource file name.

    • requestId: number

      Request ID for download progress callback.

    • ranges: { begin: number; end: number; requestId: number }[]

      A range of resource file contents to download.

    • OptionalonProgress: (progress: number, chunk: Uint8Array, requestId: number) => void

      Download progress callback.

    • Optionalsignal: AbortSignal

      An AbortController signal. Allows to communicate with a fetch request and abort it if desired.

    Returns Promise<ArrayBuffer>

  • Returns model list with one item self.

    Returns Promise<Model[]>

  • Returns a list of references of the owner file/assembly.

    References are images, fonts, or any other files to correct rendering of the file.

    Parameters

    • Optionalsignal: AbortSignal

      An AbortController signal, which can be used to abort waiting as desired.

    Returns Promise<IFileReferences>

  • Returns viewpoint snapshot as base64-encoded Data URL.

    Parameters

    • guid: string

      Viewpoint GUID.

    Returns Promise<string>

  • Returns viewpoint snapshot data.

    Parameters

    • guid: string

      Viewpoint GUID.

    • bitmapGuid: string

      Bitmap GUID.

    Returns Promise<string>

  • Returns a list of viewpoints of the owner file/assembly.

    Returns Promise<any[]>

  • Deprecated since 25.3. Use downloadResource() instead.

    Parameters

    • dataId: string
    • OptionalonProgress: (progress: number, chunk: Uint8Array) => void
    • Optionalsignal: AbortSignal

    Returns Promise<ArrayBuffer>

  • Saves a new model owner file/assembly viewpoint to the server. To create a new viewpoint use Viewer.createViewpoint().

    Parameters

    • viewpoint: any

      Viewpoint object.

    Returns Promise<any>

  • Sets or removes a model transformation.

    Parameters

    • handle: string

      Model handle.

    • Optionaltransform: IModelTransformMatrix

      Transformation matrix. Specify undefined to remove transformation.

    Returns Promise<Model>