Reference·JavaScript · @bimworks/jssdkJavaScript

Ifc

Class in @bimworks/jssdk.

API catalogue · @bimworks/jssdk · Class

TypeScript#
class Ifc

API Namespace Ifc is used for IFC related API calls.

Members#

Member Kind Description
constructor Method
compareModels Method Compare two models with a BCOL definition. The result is stored on the server: the same compare again is answered from the store (CompareResult.cached).
compareObjects Method Compares two chosen objects as a pair, by default with the built-in "everything" definition.
deleteComparePairOverride Method Takes a pair fixed by hand away again
downloadConverted Method Download a Version converted to another IFC schema. The only supported conversion is IFC2X3 to IFC4. A target schema that the model already has is no error: …
downloadIfcXml Method
downloadOriginalIfc Method
exportCompareResult Method A stored compare result as a download; resolves to a URL valid for a limited time.
exportIfc Method Export an IFC file from one or multiple models. Optionally a query can be applied.
exportIfcBvl Method As Ifc.exportIfc, filtering with a BVL script instead of a query; resolves with the download URL
getCompareBul Method The changes between two versions as BUL on the left one, verified by a dry run (docs/upload-diff-design.md §14)
getCompareResult Method Read a stored compare result, or its status while it is computed.
getMatchCandidates Method Per removed object of a stored compare, the added objects that could be it, best first
getSchemaConversionReport Method The log of a schema conversion. Reads a log, converts nothing.
listComparePairOverrides Method The pairs fixed by hand for two versions
listUsedIfcProductTypes Method
mapQids Method Maps objects of one version to their counterparts in another, for re-pointing stored references.
recordUploadAsTransaction Method Replaces an upload by a transaction with the same changes on the version before it; the new version takes the upload's number. Needs the user feature BUL (Mo…
setComparePairOverride Method Links two objects as one, or confirms an object as really removed or added, for every compare of the two versions
versionChanges Method What changed in versions since the versions before them (the built-in Default compare with the predecessor).

constructor#

TypeScript#
constructor()

compareModels#

TypeScript#
public compareModels(request: CompareModelsRequest): Promise<CompareResult>

Compare two models with a BCOL definition. The result is stored on the server: the same compare again is answered from the store (CompareResult.cached).

Parameters#

Name Type Description
request CompareModelsRequest

compareObjects#

TypeScript#
public compareObjects(left: string | Qid, right: string | Qid, options?: { bcol?: string; definition?: string } & CallOptions): Promise<{ changed_features: (string)[]; changes: Record<string, unknown>; label?: string; left: string; right: string; status: "changed" | "unchanged" | "ignored"; watched: (string)[] }>

Compares two chosen objects as a pair, by default with the built-in "everything" definition.

Parameters#

Name Type Description
left string | Qid
right string | Qid
options { bcol?: string; definition?: string } & CallOptions

deleteComparePairOverride#

TypeScript#
public deleteComparePairOverride(uuid: string): Promise<{ deleted: boolean; overrides: (ComparePairOverride)[] }>

Takes a pair fixed by hand away again

Parameters#

Name Type Description
uuid string

downloadConverted#

TypeScript#
public downloadConverted(versionUuid: string, targetSchema: string, options?: { validate?: boolean }): Promise<ConvertedDownload>

Download a Version converted to another IFC schema. The only supported conversion is IFC2X3 to IFC4. A target schema that the model already has is no error: the result then has no conversion.

Parameters#

Name Type Description
versionUuid string The UUID of the Version
targetSchema string The schema to convert to, for example "IFC4"
options { validate?: boolean } validate: hold the converted file against the schema check before it is served

downloadIfcXml#

TypeScript#
public downloadIfcXml(versionUuid: string): Promise<string>

Parameters#

Name Type Description
versionUuid string

downloadOriginalIfc#

TypeScript#
public downloadOriginalIfc(versionUuid: string): Promise<string>

Parameters#

Name Type Description
versionUuid string

exportCompareResult#

TypeScript#
public exportCompareResult(resultUuid: string, format?: "json" | "xlsx" | "csv" | "bcf", categories?: (string)[], options?: CallOptions): Promise<string>

A stored compare result as a download; resolves to a URL valid for a limited time.

Parameters#

Name Type Description
resultUuid string
format "json" | "xlsx" | "csv" | "bcf"
categories (string)[]
options CallOptions

exportIfc#

TypeScript#
public exportIfc(versionUuids: Iterable<string>, query?: string, options?: CallOptions): Promise<string>

Export an IFC file from one or multiple models. Optionally a query can be applied.

Parameters#

Name Type Description
versionUuids Iterable<string> The Version UUIDs of the models you want to export
query string An optional query to be applied
options CallOptions ui: the part of the UI a person asked this from

Returns#

A Promise that resolved to a URL, from which the export can be downloaded (limited lifetime)

exportIfcBvl#

TypeScript#
public exportIfcBvl(versionUuids: Iterable<string>, bvl: string, options?: CallOptions): Promise<string>

As Ifc.exportIfc, filtering with a BVL script instead of a query; resolves with the download URL

Parameters#

Name Type Description
versionUuids Iterable<string>
bvl string
options CallOptions

getCompareBul#

TypeScript#
public getCompareBul(leftVersionUuid: string, rightVersionUuid: string): Promise<CompareBul>

The changes between two versions as BUL on the left one, verified by a dry run (docs/upload-diff-design.md §14)

Parameters#

Name Type Description
leftVersionUuid string
rightVersionUuid string

getCompareResult#

TypeScript#
public getCompareResult(resultUuid: string, options?: CompareOptions): Promise<CompareResult>

Read a stored compare result, or its status while it is computed.

Parameters#

Name Type Description
resultUuid string
options CompareOptions

getMatchCandidates#

TypeScript#
public getMatchCandidates(resultUuid: string, options?: { leftOids?: (number)[]; leftQids?: (string | Qid)[]; limit?: number; radiusMm?: number }): Promise<MatchCandidates>

Per removed object of a stored compare, the added objects that could be it, best first

Parameters#

Name Type Description
resultUuid string
options { leftOids?: (number)[]; leftQids?: (string | Qid)[]; limit?: number; radiusMm?: number }

getSchemaConversionReport#

TypeScript#
public getSchemaConversionReport(versionUuid: string, targetSchema?: string, format?: "json" | "markdown"): Promise<{ conversion?: SchemaConversionSummary; detail_log?: boolean; markdown?: string; report?: unknown }>

The log of a schema conversion. Reads a log, converts nothing.

Parameters#

Name Type Description
versionUuid string The UUID of the Version
targetSchema string Only for a converted download, the schema it was converted to
format "json" | "markdown" "json" (default) or "markdown"

listComparePairOverrides#

TypeScript#
public listComparePairOverrides(left: string, right: string): Promise<(ComparePairOverride)[]>

The pairs fixed by hand for two versions

Parameters#

Name Type Description
left string
right string

listUsedIfcProductTypes#

TypeScript#
public listUsedIfcProductTypes(versionUuids: Iterable<string>): Promise<unknown>

Parameters#

Name Type Description
versionUuids Iterable<string>

mapQids#

TypeScript#
public mapQids(request: { all?: boolean; from: string; oids?: (number)[]; qids?: (string)[]; to: string; via?: string }): Promise<{ from_version: string; matchers: (string)[]; pairs: { from: (number)[]; matched_by: (number)[]; to: (number)[] }; result_uuid: string; to_version: string; unmatched: (number)[] }>

Maps objects of one version to their counterparts in another, for re-pointing stored references.

Parameters#

Name Type Description
request { all?: boolean; from: string; oids?: (number)[]; qids?: (string)[]; to: string; via?: string }

recordUploadAsTransaction#

TypeScript#
public recordUploadAsTransaction(versionUuid: string, comment?: string): Promise<{ node: Record<string, unknown>; replaced_version_uuid: string; transaction: { transaction_uuid: string; version: number; version_uuid: string } }>

Replaces an upload by a transaction with the same changes on the version before it; the new version takes the upload's number. Needs the user feature BUL (Model editing)

Parameters#

Name Type Description
versionUuid string
comment string

setComparePairOverride#

TypeScript#
public setComparePairOverride(override: { kind: "removed" | "pair" | "added"; left: string; leftOid?: number; note?: string; right: string; rightOid?: number }): Promise<{ override: ComparePairOverride; overrides: (ComparePairOverride)[] }>

Links two objects as one, or confirms an object as really removed or added, for every compare of the two versions

Parameters#

Name Type Description
override { kind: "removed" | "pair" | "added"; left: string; leftOid?: number; note?: string; right: string; rightOid?: number }

versionChanges#

TypeScript#
public versionChanges(versionUuids: string | (string)[], options?: { onlyStored?: boolean }): Promise<(VersionChange)[]>

What changed in versions since the versions before them (the built-in Default compare with the predecessor).

Parameters#

Name Type Description
versionUuids string | (string)[]
options { onlyStored?: boolean }