Class Assembly

Provides properties and methods for obtaining information about an assembly on the Open Cloud Server and managing its data.

Hierarchy (View Summary)

Constructors

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 created(): string
  • Assembly creation time (UTC) in the format specified in ISO 8601.

    Returns string

  • get data(): any
  • Returns the raw assembly data received from the server. For more information, see Open Cloud Assemblies API.

    Returns any

  • get files(): string[]
  • List of file IDs from which the assembly was created.

    Returns string[]

  • get geometryType(): string
  • Assembly geometry data type:

    • vsfx - VSFX format, assembly can be opened in VisualizeJS viewer.

    Returns an empty string if the geometry data is not yet ready.

    Returns string

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

    Returns string

  • get name(): string
  • Assembly name.

    Returns string

  • get relatedJobs(): string[]
  • List of assembly related job IDs.

    Returns string[]

  • get status(): string
  • Assembly geometry data and properties status. Can be waiting, inprogress, done or failed.

    An assemblies without geometry data cannot be opened in viewer.

    Returns string

  • get type(): string
  • Assembly type. Returns an assembly string.

    Returns string

Methods

  • Reloads assembly data from the server.

    Returns Promise<Assembly>

  • Creates an assembly clash test. Assembly must be in a done state, otherwise the test will fail.

    Parameters

    • name: string

      Test name.

    • selectionTypeA: string

      The type of first selection set for clash detection. Can be one of:

      • all - All file/assembly objects.
      • handle - Objects with original handles specified in the selectionSetA.
      • models - All objects of the models with original handles specified in the selectionSetA.
      • searchquery - Objects retrieved by the search queries specified in selectionSetA.
    • selectionTypeB: string

      The type of second selection set for clash detection. Can be one of:

      • all - All file/assembly objects.
      • handle - Objects with original handles specified in the selectionSetB.
      • models - All objects of the models with original handles specified in the selectionSetB.
      • searchquery - Objects retrieved by the search queries specified in selectionSetB.
    • OptionalselectionSetA: string | string[]

      First selection set for clash detection. Objects from selectionSetA will be tested against each others by objects from the selectionSetB during the test.

    • OptionalselectionSetB: string | string[]

      Second selection set for clash detection. Objects from selectionSetB will be tested against each others by objects from the selectionSetA during the test.

    • Optionalparams: {
          clearance?: boolean;
          interval?: number;
          signal?: AbortSignal;
          timeout?: number;
          tolerance?: string | number;
          waitForDone?: boolean;
      }

      An object containing test parameters.

      • Optionalclearance?: boolean

        The type of the clashes that the test detects:

        • true - Сlearance clash. A clash in which the object A may or may not intersect with object B, but comes within a distance of less than the tolerance.
        • false - Hard clash. A clash in which the object A intersects with object B by a distance of more than the tolerance.
      • Optionalinterval?: number

        The time, in milliseconds, the function should delay in between checking test status.

      • Optionalsignal?: AbortSignal

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

      • Optionaltimeout?: number

        The time, in milliseconds that the function should wait test. If test is not complete during this time, the TimeoutError exception will be thrown.

      • Optionaltolerance?: string | number

        The distance of separation between objects at which test begins detecting clashes.

      • OptionalwaitForDone?: boolean

        Wait for test to complete.

    Returns Promise<ClashTest>

  • Deletes an assembly from the server.

    Returns Promise<any>

    Returns the raw data of a deleted assembly. For more information, see Open Cloud Assemblies API.

  • Deletes the specified assembly clash test.

    Parameters

    • testId: string

      Test ID.

    Returns Promise<any>

    Returns the raw data of a deleted test. For more information, see Open Cloud Assemblies API.

  • Deletes the specified assembly viewpoint.

    Parameters

    • guid: string

      Viewpoint GUID.

    Returns Promise<any>

    Returns a deleted viewpoint. For more information, see Open Cloud Assembly Viewpoints API.

  • 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 an assembly 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 assembly 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 the CDA tree for an assembly.

    Returns Promise<ICdaNode[]>

  • Returns information about the specified assembly clash test.

    Parameters

    • testId: string

      Test ID.

    Returns Promise<ClashTest>

  • Returns a list of assembly clash tests.

    Parameters

    • Optionalstart: number

      The starting index in the test list. Used for paging.

    • Optionallimit: number

      The maximum number of tests that should be returned per request. Used for paging.

    • Optionalname: string

      Filter the tests by part of the name. Case sensitive.

    • Optionalids: string | string[]

      List of tests IDs to return.

    • OptionalsortByDesc: boolean

      Allows to specify the descending order of the result. By default tests are sorted by name in ascending order.

    • OptionalsortField: string

      Allows to specify sort field.

    Returns Promise<
        {
            allSize: number;
            limit: number;
            result: ClashTest[];
            size: number;
            start: number;
        },
    >

  • Returns list of assembly models.

    Returns Promise<Model[]>

  • Returns the properties for an objects in the assembly.

    Parameters

    • Optionalhandles: string | string[]

      Object original handle or handles array. Specify undefined to get properties for all objects in the assembly.

    Returns Promise<any[]>

  • Returns a list of assembly references containing references from all the files from which the assembly was created.

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

    Parameters

    • Optionalsignal: AbortSignal

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

    Returns Promise<IFileReferences>

  • Returns the viewpoint snapshot as base64-encoded Data URL.

    Parameters

    • guid: string

      Viewpoint GUID.

    Returns Promise<string>

  • Returns the viewpoint snapshot data.

    Parameters

    • guid: string

      Viewpoint GUID.

    • bitmapGuid: string

      Bitmap GUID.

    Returns Promise<string>

  • Deprecated since 25.3. Use downloadResource() instead.

    Parameters

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

    Returns Promise<ArrayBuffer>

  • Saves assembly properties changes to the server. Call this method to update assembly data on the server after any property changes.

    Returns Promise<Assembly>

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

    Parameters

    Returns Promise<any>

  • Returns the list of original handles for an objects in the file that match the specified patterns. Search patterns may be combined using query operators.

    Parameters

    • searchPattern: any

      Search pattern or combination of the patterns, see example below.

    Returns Promise<any[]>

    searchPattern = {
    key: "Category",
    value: "OST_Stairs",
    };
    searchPattern = {
    $or: [
    {
    $and: [
    { key: "Category", value: "OST_GenericModel" },
    { key: "Level", value: "03 - Floor" },
    ],
    },
    { key: "Category", value: "OST_Stairs" },
    ],
    };
  • Sets or removes a model transformation.

    Parameters

    • handle: string

      Model original handle.

    • Optionaltransform: IModelTransformMatrix

      Transformation matrix. Specify undefined to remove transformation.

    Returns Promise<Assembly>

  • Waits for assembly to be created. Assembly is created when it changes to done or failed status.

    Parameters

    • Optionalparams: {
          interval?: number;
          onCheckout?: (assembly: Assembly, ready: boolean) => boolean;
          signal?: AbortSignal;
          timeout?: number;
      }

      An object containing waiting parameters.

      • Optionalinterval?: number

        The time, in milliseconds, the function should delay in between checking assembly status.

      • OptionalonCheckout?: (assembly: Assembly, ready: boolean) => boolean

        Waiting progress callback. Return true to cancel waiting.

      • Optionalsignal?: AbortSignal

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

      • Optionaltimeout?: number

        The time, in milliseconds that the function should wait assembly. If assembly is not created during this time, the TimeoutError exception will be thrown.

    Returns Promise<Assembly>