---
title: BSL
summary: The BIM.works Sequence Language — a list of labelled frames, each a BVL script, played as a sequence of viewer states; syntax, resolution through ResolveBsl, and where sequences run.
order: 60
terms: [action]
requires: [BSL]
see-also: [reference/bvl, reference/bql/order-by, how-to/using-bimworks/use-the-actions-tree]
---

# BSL

BSL turns a series of visualisations into a sequence: each frame is a [[page:reference/bvl|BVL]] script, and the viewer steps from frame to frame — construction phases, a walk through the systems, a before-and-after. The grammar builds on BVL ([[bsl:grammar]]), so a frame has the whole BVL vocabulary and every BQL condition.

## Where it runs {#where}

A *Sequence* action (type `BSL`) in the Actions tree stores the frames and plays them in the 3D viewer, with the frame labels as the steps ([[page:how-to/using-bimworks/use-the-actions-tree]]). Needs the [[feature:BSL]] feature. The `ResolveBsl` task takes `models` and either `input`, the sequence as text or as its syntax tree, or `query_uuid`, a stored *Sequence* action you may read. It resolves every frame as `ResolveBvl` resolves a script, with the same `parameters` and `include_non_geometric`, and returns `frames`: per frame, in order, its `label` (absent when the frame has none) and the actions `ResolveBvl` returns for that script. A sequence with a syntax error is refused with `SYNTAX_ERROR`, and so is a frame whose condition uses a feature the workspace hides (`FEATURE_NOT_VISIBLE`).

## Syntax {#syntax}

```text {#bsl-syntax}
{ [label "<text>"] <bvl content> } [, { ... } ...]
```

Frames are comma-separated blocks; the optional `label` names the frame. The frame's content is BVL block content — `group` blocks, action sets and `if` chains, in that order — and an empty frame is allowed.

```bsl {#bsl-phases}
{ label "Structure"
  if (type IN (IFCWALL, IFCSLAB, IFCCOLUMN, IFCBEAM)) { SHOW; } else { HIDE; } },
{ label "Envelope"
  if (type = IFCWALL AND property.Pset_WallCommon.IsExternal = true) { SHOW COLOR "#3070b3"; } else { HIDE; } },
{ label "Openings"
  if (type IN (IFCDOOR, IFCWINDOW)) { SHOW COLOR "orange" VIEWFIT; } },
{ label "Everything"
  if (ALL) { SHOW COLOR RESET; } }
```

```bsl {#bsl-storeys}
{ label "Ground floor"
  if (buildingStorey.calculated.property.level = 0) { SHOW; } else { HIDE; } },
{ label "First floor"
  if (buildingStorey.calculated.property.level <= 1) { SHOW; } else { HIDE; } },
{ label "Second floor"
  if (buildingStorey.calculated.property.level <= 2) { SHOW; } else { HIDE; } }
```

## Frames and state {#state}

Each frame is resolved independently against the models, so a frame states the complete picture it wants (what to show *and* what to hide), not the difference from the previous one. A frame that only colours leaves visibility as the viewer had it. The Actions tree applies the frame you step to on what the viewer shows at that moment, also when you step back or jump: the *Openings* frame above only shows objects, so reached from *Envelope* it adds the openings to the envelope, and reached from *Everything* it leaves everything visible.

## Ordering objects within a frame {#ordering}

A BVL condition may sort and limit (`ORDER BY ... LIMIT n`), and BQL's `ORDER BY GEOMETRY(...)` produces a spatial walking order ([[bql:order-by#geometry]]); together with `SEQ` labels they number objects along a route inside one frame.

```bsl {#bsl-route}
{ label "Doors along the corridor"
  if (type = IFCDOOR ORDER BY GEOMETRY(attribute.Name = "Main entrance")) { label(SEQ, ANNOTATION) SHOW; } }
```

## Used in {#used-in}

- [[page:how-to/using-bimworks/use-the-actions-tree]] — playing a stored sequence.
