Reference·JavaScript · @bimworks/jssdkJavaScript

CompareResult

Class in @bimworks/jssdk.

API catalogue · @bimworks/jssdk · Class

TypeScript#
class CompareResult

A model compare result: the document CompareModels and GetCompareResult answer, with the object sets as QidSets and the correspondence between the sides. Object sets need details "objects" or more, records "changes" or more, layers "full".

Members#

Member Kind Description
constructor Method
alignment Property The rigid move most matched objects share, null when there is none
cached Property
categories Property
clusters Property Units that changed alike, the largest first
document Property
error Property
federated Property Whether either side is a federation
groups Property The summary by the definition's group by
hiddenFeatures Property
layers Property
left Property The left side; a federation's has its models, and its version_uuid names no Version
leftVid Property The left Version; a federation's first model
leftVids Property The Versions of each side: one, or a federation's models
moves Property The pairs that moved (details "full" with layers): items [left oid, right oid, from x, y, z, to x, y, z] in world mm
paging Property
ready Property
records Property
resultUuid Property
right Property
rightVid Property
rightVids Property
stats Property
status Property
warnings Property
category Method
categoryOf Method The category an object is in
clusterObjects Method The objects of a cluster (details "objects" and up)
counterpart Method The paired object on the other side; null for added, removed or unknown objects
loadRecords Method Loads a page of records from the server
moveQids Method The qids of the pair of moves item i
objects Method The objects of a category on one side or both
recordQid Method The qid ("vid-oid") of one side of a record, null when it has none there
whenReady Method Waits until a compare that was still running is ready

constructor#

TypeScript#
constructor()

alignment#

TypeScript#
readonly alignment: CompareAlignment | null

The rigid move most matched objects share, null when there is none

cached#

TypeScript#
readonly cached: boolean

categories#

TypeScript#
readonly categories: (CompareCategory)[]

clusters#

TypeScript#
readonly clusters: (CompareCluster)[]

Units that changed alike, the largest first

document#

TypeScript#
readonly document: Record<string, unknown>

error#

TypeScript#
readonly error?: string

federated#

TypeScript#
readonly federated: boolean

Whether either side is a federation

groups#

TypeScript#
readonly groups: ({ counts: Record<string, number>; key: Record<string, string | null>; total: number })[]

The summary by the definition's group by

hiddenFeatures#

TypeScript#
readonly hiddenFeatures: (string)[]

layers#

TypeScript#
readonly layers: (CompareLayer)[]

left#

TypeScript#
readonly left: CompareResultSide | null

The left side; a federation's has its models, and its version_uuid names no Version

leftVid#

TypeScript#
readonly leftVid: string

The left Version; a federation's first model

leftVids#

TypeScript#
readonly leftVids: (string)[]

The Versions of each side: one, or a federation's models

moves#

TypeScript#
readonly moves: { count: number; items: ((number)[])[]; left_v?: (number)[]; right_v?: (number)[]; truncated?: boolean } | null

The pairs that moved (details "full" with layers): items [left oid, right oid, from x, y, z, to x, y, z] in world mm

paging#

TypeScript#
readonly paging: { category?: string; limit: number; offset: number; returned: number; total: number } | null

ready#

TypeScript#
readonly ready: boolean

records#

TypeScript#
readonly records: (CompareRecord)[]

resultUuid#

TypeScript#
readonly resultUuid: string

right#

TypeScript#
readonly right: CompareResultSide | null

rightVid#

TypeScript#
readonly rightVid: string

rightVids#

TypeScript#
readonly rightVids: (string)[]

stats#

TypeScript#
readonly stats: Record<string, unknown>

status#

TypeScript#
readonly status: "FAILED" | "PENDING" | "RUNNING" | "READY"

warnings#

TypeScript#
readonly warnings: ({ code: string; details?: unknown; message: string })[]

category#

TypeScript#
category(id: string): CompareCategory | null

Parameters#

Name Type Description
id string

categoryOf#

TypeScript#
categoryOf(qid: string | Qid): string | null

The category an object is in

Parameters#

Name Type Description
qid string | Qid

clusterObjects#

TypeScript#
clusterObjects(clusterId: string, side?: "both" | "left" | "right"): QidSet

The objects of a cluster (details "objects" and up)

Parameters#

Name Type Description
clusterId string
side "both" | "left" | "right"

counterpart#

TypeScript#
counterpart(qid: string | Qid): string | null

The paired object on the other side; null for added, removed or unknown objects

Parameters#

Name Type Description
qid string | Qid

loadRecords#

TypeScript#
loadRecords(page?: { category?: string; details?: "changes" | "full"; limit?: number; offset?: number }): Promise<(CompareRecord)[]>

Loads a page of records from the server

Parameters#

Name Type Description
page { category?: string; details?: "changes" | "full"; limit?: number; offset?: number }

moveQids#

TypeScript#
moveQids(i: number): { left: string; right: string }

The qids of the pair of moves item i

Parameters#

Name Type Description
i number

objects#

TypeScript#
objects(categoryId: string, side?: "both" | "left" | "right"): QidSet

The objects of a category on one side or both

Parameters#

Name Type Description
categoryId string
side "both" | "left" | "right"

recordQid#

TypeScript#
recordQid(record: CompareRecord, side: "left" | "right"): string | null

The qid ("vid-oid") of one side of a record, null when it has none there

Parameters#

Name Type Description
record CompareRecord
side "left" | "right"

whenReady#

TypeScript#
whenReady(options?: { details?: "summary" | "objects" | "changes" | "full"; intervalMs?: number; timeoutMs?: number }): Promise<CompareResult>

Waits until a compare that was still running is ready

Parameters#

Name Type Description
options { details?: "summary" | "objects" | "changes" | "full"; intervalMs?: number; timeoutMs?: number }