---
title: "Render Cesium Tilesets"
section: "Libraries: Web"
route: /webrendertilesets
account: {accountId}
bruce_api: https://{accountId}.api.nextspace.host
guardian_api: https://guardian.nextspace.host
---
# Render Cesium Tilesets

If you've performed an import of a BIM, CAD, or point cloud file, you can render it through the library without having to create a Project View.

This also includes static mesh Tilesets you've uploaded from your own files.

You will need to know the `tilesetId` that was generated from your import.

[JSFiddle example](https://jsfiddle.net/crz4wn5b/)

## Listing and rendering

Below is how you can list what Tilesets you've got available to render. We can find the `tilesetId` from here.

**Typescript**

```typescript
import { ENVIRONMENT, Tileset } from "bruce-models";
import { MenuItemCreator } from "bruce-cesium"; 
import * as Cesium from "cesium";

// Setup global defaults.
ENVIRONMENT.PARAMS = {
    ...ENVIRONMENT.PARAMS,
    accountId: "your-account-id"
};

/**
 * @Warning it is recommended to set a sessionId prior to making this request.
 * The GetList call will not include information on what Tilesets were excluded due to permissions.
 */
Tileset.GetList({}).then((data) => {
    // You can use the ".name" property and allow the user to select what they'd like to render.
    console.log("Tilesets", data.tilesets);

    // CAD. Eg: IFC, BRZ, etc.
    const cad = data.tilesets.filter(x => x.type == Tileset.EType.Cad);

    // Point clouds.
    const pointClouds = data.tilesets.filter(x => x.type == Tileset.EType.PointCloud);

    // Entities.
    // This is created from an Entity Type of arbitrary Entities, eg: vector polygons.
    const entities = data.tilesets.filter(x => x.type == Tileset.EType.EntitiesSet);

    // Static files uploaded directly by a user.
    // This is usually a mesh tileset.
    const userFiles = data.tilesets.filter(x => x.type == Tileset.EType.LegacyStatic);
}).catch((e) => {
    console.error(e);
});

// Cannot be null in real use!
// Check earlier docs for initialization of the Cesium viewer.
const viewer: Cesium.Viewer = null;

// Render using a record.
// This cannot be null in real use. Retrieve the record then plug it in.
const someSpecificRecord: Tileset.ITileset = null;
MenuItemCreator.RenderTileset({
    tileset: someSpecificRecord,
    viewer: viewer
});

// Render using an ID.
const someTilesetId: string = "some-tileset-id";
MenuItemCreator.RenderTileset({
    tilesetId: someTilesetId,
    viewer: viewer
});
```

**Javascript**

```javascript
// Setup global defaults.
BModels.ENVIRONMENT.PARAMS = {
    ...BModels.ENVIRONMENT.PARAMS,
    accountId: "your-account-id"
};

/**
 * @Warning it is recommended to set a sessionId prior to making this request.
 * The GetList call will not include information on what Tilesets were excluded due to permissions.
 */
BModels.Tileset.GetList({}).then((data) => {
    // You can use the ".name" property and allow the user to select what they'd like to render.
    console.log("Tilesets", data.tilesets);

    // CAD. Eg: IFC, BRZ, etc.
    const cad = data.tilesets.filter(x => x.type == BModels.Tileset.EType.Cad);

    // Point clouds.
    const pointClouds = data.tilesets.filter(x => x.type == BModels.Tileset.EType.PointCloud);

    // Entities.
    // This is created from an Entity Type of arbitrary Entities, eg: vector polygons.
    const entities = data.tilesets.filter(x => x.type == BModels.Tileset.EType.EntitiesSet);

    // Static files uploaded directly by a user.
    // This is usually a mesh tileset.
    const userFiles = data.tilesets.filter(x => x.type == BModels.Tileset.EType.LegacyStatic);
}).catch((e) => {
    console.error(e);
});

// Cannot be null in real use!
// Check earlier docs for initialization of the Cesium viewer.
const viewer = null;

// Render using a record.
// This cannot be null in real use. Retrieve the record then plug it in.
const someSpecificRecord = null;
BEngine.MenuItemCreator.RenderTileset({
    tileset: someSpecificRecord,
    viewer: viewer
});

// Render using an ID.
const someTilesetId = "some-tileset-id";
BEngine.MenuItemCreator.RenderTileset({
    tilesetId: someTilesetId,
    viewer: viewer
});
```

---

Urls on this page are resolved for account `{accountId}`.
Site index: https://docs.nextspace.host/llms.txt · whole site in one file: https://docs.nextspace.host/llms-full.txt
Human-readable version of this page: https://docs.nextspace.host/webrendertilesets
