---
title: BvlHelper
summary: Class in @bimworks/viewercommon.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/viewercommon
---

# BvlHelper

[[page:reference/javascript/api|API catalogue]] · `@bimworks/viewercommon` · Class

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
class BvlHelper
````

The BVL runtime: shows resolved BVL actions (the server's ResolvedActions JSON, documented with the
BVL language) in the viewers - colours, visibility, selection, labels, annotations, shapes, routes and
check overlays (docs/ui-api-wp5/README.md §2.6)

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-viewercommon/bvlhelper-bee3a586#member-constructor-fc832de43efd|constructor]] | Method |  |
| [[page:reference/javascript/bimworks-viewercommon/bvlhelper-bee3a586#member-iconroot-76f9f7dac367|iconRoot]] | Property | Where the app's img/ folder is, for svg("glyphicons-…") icons: the page's own folder ("") by default |
| [[page:reference/javascript/bimworks-viewercommon/bvlhelper-bee3a586#member-applydelta-910bac1360be|applyDelta]] | Method | Applies a pick's actions on top of what is shown: only colours (also COLOR RESULT), ON_TOP, SHOW of hidden objects and annotations, the ones that can be take… |
| [[page:reference/javascript/bimworks-viewercommon/bvlhelper-bee3a586#member-execute-c4b1eea604e7|execute]] | Method | Resolves BVL input on the server (ResolveBvl) and shows the result; rejects when the server refuses it. `options.ui`: the part of the UI a person asked this … |
| [[page:reference/javascript/bimworks-viewercommon/bvlhelper-bee3a586#member-objectstofit-9bdc57a4dfc0|objectsToFit]] | Method | The objects resolved BVL actions are about, to fit the view to once processResults applied them: the VIEWFIT objects when the script names any; else those it… |
| [[page:reference/javascript/bimworks-viewercommon/bvlhelper-bee3a586#member-processresults-191623d0a2e0|processResults]] | Method | Shows resolved BVL actions; by default it first takes away the previous result (Viewer3d.resetResults). Resolves to the Transition once its state is in when … |
| [[page:reference/javascript/bimworks-viewercommon/bvlhelper-bee3a586#member-undodelta-3b35b8977356|undoDelta]] | Method | Takes a pick away again: what applyDelta returned |

## `constructor` {#member-constructor-fc832de43efd}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
constructor(objectStateManager: ObjectStateManager, viewer3d?: unknown)
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `objectStateManager` | [[page:reference/javascript/bimworks-viewercommon/objectstatemanager-306af1d6|ObjectStateManager]] |  |
| `viewer3d` | `unknown` | a Viewer3d; without one only colours, visibility, selection and labels are applied        (no shapes, routes, overlays or measurements) |

## `iconRoot` {#member-iconroot-76f9f7dac367}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
static iconRoot: string
````

Where the app's img/ folder is, for svg("glyphicons-…") icons: the page's own folder ("") by default

## `applyDelta` {#member-applydelta-910bac1360be}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
applyDelta(actions: object, options?: { resultColorOf?: (qid: string) => string | null | null }): Promise<BvlUndo>
````

Applies a pick's actions on top of what is shown: only colours (also COLOR RESULT), ON_TOP, SHOW of
hidden objects and annotations, the ones that can be taken away again; returns how to

### Parameters

| Name | Type | Description |
|---|---|---|
| `actions` | `object` |  |
| `options` | `{ resultColorOf?: (qid: string) => string \| null \| null }` |  |

## `execute` {#member-execute-c4b1eea604e7}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
execute(versionUuids: (string)[], input: string | object, options?: { ui?: string }): Promise<void>
````

Resolves BVL input on the server (ResolveBvl) and shows the result; rejects when the server refuses it. `options.ui`: the part of the UI a person asked this from, sent as the request's `ui`

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuids` | `(string)[]` |  |
| `input` | `string \| object` |  |
| `options` | `{ ui?: string }` |  |

## `objectsToFit` {#member-objectstofit-9bdc57a4dfc0}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
objectsToFit(resolved: (object)[]): QidSet
````

The objects resolved BVL actions are about, to fit the view to once `processResults` applied them: the
VIEWFIT objects when the script names any; else those it shows, selects, puts on top, labels, annotates, gives a
shape or a colour less than half transparent; else every object it colours. Never the ones it hides, and only
those the viewer shows. Empty when there are none

### Parameters

| Name | Type | Description |
|---|---|---|
| `resolved` | `(object)[]` |  |

## `processResults` {#member-processresults-191623d0a2e0}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
processResults(resolved: (object)[], options?: BvlProcessOptions): Promise<void | Transition>
````

Shows resolved BVL actions; by default it first takes away the previous result (Viewer3d.resetResults). Resolves
to the Transition once its state is in when it applies one (options.transition, or the script's TRANSITION header)

### Parameters

| Name | Type | Description |
|---|---|---|
| `resolved` | `(object)[]` |  |
| `options` | [[page:reference/javascript/bimworks-viewercommon/bvlprocessoptions-0c06dd13|BvlProcessOptions]] |  |

## `undoDelta` {#member-undodelta-3b35b8977356}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
undoDelta(undo: BvlUndo | null): Promise<void>
````

Takes a pick away again: what `applyDelta` returned

### Parameters

| Name | Type | Description |
|---|---|---|
| `undo` | `BvlUndo \| null` |  |
