Appearance
KBE3D / KBCore / Cesium / ITwinData / createTilesetFromIModelId
函数: createTilesetFromIModelId()
createTilesetFromIModelId(
options: {iModelId:string;tilesetOptions?:ConstructorOptions;changesetId?:string; }):Promise<Cesium3DTileset|undefined>
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 <code>undefined</code>. We recommend waiting 10-20 seconds and trying to load the tileset again. If all exports are Invalid this will throw an error.
See the iTwin Platform Mesh Export API documentation for more information on request parameters
参数
options
iModelId
string
The id of the iModel to load
tilesetOptions?
Object containing options to pass to the internally created Cesium3DTileset.
changesetId?
string
The id of the changeset to load, if not provided the latest changesets will be used
返回
Promise<Cesium3DTileset | undefined>
A promise that will resolve to the created 3D tileset or undefined if there is no completed export for the given iModel id
示例
ts
const tileset = await Cesium.ITwinData.createTilesetFromIModelId({ iModelId });
if (Cesium.defined(tileset)) {
viewer.scene.primitives.add(tileset);
}