---
title: Site log
summary: A construction manager logs issues using the 3D viewer.
order: 20
layout: wide
languages: [javascript]
terms: [viewer, annotation, viewpoint, object-state-manager, qid, building-storey, calculated-value]
see-also: [how-to/viewer3d/annotations, how-to/viewer3d/embed-the-viewer, how-to/viewer3d/hide-and-isolate, demos/repair-annotations]
---

# Site log

Left: the model with the issues as [[term:annotation|annotations]]. Right: the register. The log starts empty.

```demo
name: site-log
title: Site log
models: s1, s1-electrical
height: 800
needs: Uses the demo [[term:api-token|API token]] of your [[term:account|account]]: sign in to BIM.works once in this browser.
```

## Try it

1. **Log an issue.** Pick a kind in the toolbar and click in the model; pick a storey under *Show* to look inside. The pin previews the form while you type.
2. **Let the model measure.** A deviation starts from the clicked object's height, extra work from its area, volume or length; you type only what you measured or the unit price.
3. **Read the pins.** The shape is the kind, the colour the status: red needs action, yellow under way, green done, grey closed. Hover a pin for its card.
4. **Go back.** Click a register row or *Viewpoint* on a card: the camera returns to where the issue was logged.
5. **Keep the overview.** Storey tags count the open issues per storey; the tiles above the register add up each kind and hide or show its pins.

## The templates

One template per kind, each on its own annotation layer. The pin is a signpost with a plate; the card shares a snapshot, status, notes and *Viewpoint* / *Edit*, with a figure of its own.

| Kind | Plate | Card figure |
|---|---|---|
| Deviation | `+40` mm, red outside the tolerance | Tolerance gauge |
| Change | `+€2.4k` or `+3 d` | Cost and time tiles |
| Extra work | `€558` | Invoice line: quantity × price |
| Coordination | The trade whose move it is | The trades, the one to act ringed |
| Planning | `wk 45`, red when late | Planned against forecast bars |

One more template draws the storey tags, on a row about the objects that lie on a storey.

## Where the issues are kept

In this page's memory only: reload and the log is empty. The records belong in your application's database; BIM.works supplies the place (point and [[term:qid|Qid]]), the view (viewpoint, visible set, snapshot), the measures and the drawing. A Qid belongs to one version; keep the IFC GlobalId to follow an object across versions.

## How it is built

The modules are in `BimRepository/www/docs-runtime/demos/sitelog/`.

| What | How | Where it is explained |
|---|---|---|
| 3D view | One `Viewer3d` with its [[term:model-manager|ModelManager]] and [[term:object-state-manager|ObjectStateManager]]. | [[page:how-to/viewer3d/embed-the-viewer]] |
| Clicking a point | `viewer.setClickHandler` and `viewer.pick(x, y)`. | [[page:how-to/viewer3d/measure#own-click-tool|A click tool of your own]] |
| Measures | `client.bim.query` for the object's `aabb` and [[term:calculated-value|calculated]] quantities. | [[page:reference/bql/calculated-values]] |
| Pins and cards | Five annotation layers with `defineTemplate` and `AnnotationTemplateKit`; `layer.expand(id, {pin: true})` opens a card. | [[page:how-to/viewer3d/annotations]] |
| Storey tags | One more layer with rows about many objects (`qids`). | [[page:how-to/viewer3d/annotations]] |
| Storeys | `client.bim.listBuildingStoreys`, `getObjectQidsForBuildingStoreyQids` and `setVisibleSet`. | [[page:how-to/viewer3d/hide-and-isolate]] |
| Coloured objects | `objectStateManager.changeColorMulti` and `resetColor`. | [[page:how-to/viewer3d/select-and-colour-objects]] |
| An issue's view | `getCamera().getViewpoint()` and `getVisibleQids()` to store, `setVisibleSet` and `setViewpoint` to restore, `viewer.screenshot({annotations: true})` for the snapshot. | [[term:viewpoint]] |
