createTilesetFromIModelId

suspend fun createTilesetFromIModelId(iModelId: String, options: Cesium3DTileset.ConstructorOptions? = definedExternally): Cesium3DTileset?(source)

Create a Cesium3DTileset for the given iModel id using iTwin's Mesh Export API.

If there is not a completed export available for the given iModel id, the returned promise will resolve to undefined. We recommend waiting 10-20 seconds and trying to load the tileset again. If all exports are Invalid this will throw an error.

const tileset = await ITwinData.createTilesetFromIModelId(iModelId);
if (defined(tileset)) {
viewer.scene.primitives.add(tileset);
}

Return

A promise that will resolve to the created 3D tileset or undefined if there is no completed export for the given iModel id

Parameters

iModelId

The id of the iModel to load

options

Object containing options to pass to the internally created Cesium3DTileset.

See also