---
title: From 2 to 3
summary: []
order: 10
languages: []
terms: [api-token, scope, bql, bvl, bcl, bsl, bcol, ids, reindex, calculated-value, viewpoint, qid, versions-token, transaction]
status: draft
see-also: [changelog/v3-0, changelog/v3-0/bql, explanation/versioning-and-compatibility, reference/bql/unit, how-to/using-bimworks/manage-api-tokens]
notion: https://app.notion.com/p/398e41afde7f8180b3fde2a7224a3735
---

# From 2 to 3

This page lists what changes for an application, an integration or a stored action built against BIM.works 2.x when it moves to 3.0, and what to do about it. It assumes that the SDKs and packages are upgraded together with the instance ([[page:explanation/versioning-and-compatibility#sdks-in-lockstep]]). A 2.x SDK, 3D viewer or client talking to a 3.0 instance is not a supported combination.

The data a model returns does not change: attributes, property sets and quantity sets come back the same. What changes is around that data: how a client authenticates, the SDK APIs, how [[term:bql|BQL]] reads queries and shapes and counts its answers, the values BIM.works derives from the geometry, and the web application. Many BQL changes are corrections, where 2.x gave a wrong answer and 3.0 gives the right one.

## Before you start

- A 3.0 test instance holding copies of your own models, to run your stored actions on and compare numbers with.
- An inventory of what your integration uses:
  - the [[term:api-token|API tokens]] in use, what each one calls, and its owner;
  - the [[term:action|stored actions]]: queries, visualisations, checks, compare and clash definitions, [[term:viewpoint|viewpoints]], IDS files;
  - the BQL in your code, and the SDK calls you make;
  - the numbers your reports and checks produce, for comparison later.

## Steps

1. Run every stored action on the 3.0 test instance, and rewrite what fails ([query languages](#query-languages), [checks](#checks)).
2. Upgrade every SDK and package to the instance's version. Fix the compile errors first, then the behaviour changes ([SDKs](#sdks)).
3. Adapt token handling and the calls that were removed or changed ([tokens](#tokens), [calls](#calls)).
4. Once the operator has [[term:reindex|reindexed]] your models, compare the numbers your reports give on 2.x and on 3.0 ([model data](#model-data)).
5. Switch over, and recreate your API tokens with [[term:scope|scopes]] and an expiry.

## Tokens and logins {#tokens}

**API tokens have scopes and expire.**
- A new API token expires after one month by default and after three years at most. It has the format `BAT-…`.
- A 2.x READ or READ/WRITE token keeps working. It is mapped to a fixed set of scopes that is narrower than what it could do in 2.x:
  - a READ token can no longer comment, edit actions, or set a georeference, alignment or discipline;
  - both kinds lose `checks:write` and every [[term:superadmin|superadmin]] task.
- Some scopes need something of the token's owner, or the call answers `NON_AUTHORIZED_SCOPE`:
  - `admin:read` and `admin:write`, which cover creating API tokens: an [[term:organisation|organisation]] the owner owns;
  - `collab:read` and `collab:write`: the `COMMENTING` feature;
  - the workspace, bSDD, AI and `checks:write` scopes: their own features.
- A 2.x token has no expiry unless one is set. Editing it in the web application gives it one month.

Recreate your tokens with explicit scopes and an expiry that fits a rotation you plan for ([[page:how-to/auth/create-an-api-token]], [[page:how-to/using-bimworks/manage-api-tokens]]). A token that has expired answers `API_TOKEN_EXPIRED` at login.

**Calls without a login are refused.** Without a credential, only the 27 public calls run: the logins, `GetApplicationVersion` and a few more, other calls now answer `NO_AUTHORIZATION`.

**Tokens for browsers take scopes.** Create [[term:versions-token|versions]], [[term:nodes-token|nodes]] and [[term:recursive-node-token|recursive node tokens]] with scopes: a viewer page needs `fs:read`, `geometry:read` and `query:run`, plus `gis:read` when it shows a map ([[page:how-to/auth/create-a-versions-token]]). The task-name list is deprecated. When the issuer is logged in with an API token:
- every name in the list is validated, so a name 3.0 does not have gives `INVALID_TASK_NAME`, with the likely intended name in the message (2.x lists often name `TableExport2`, which never existed: use `TableExport`);
- the issued token also carries the issuer's scopes, and reaches every call those scopes and its resource rights allow, not only the listed ones.

A token minted with a 2.x task list and a 2.x [[term:share-link|share link]] cannot do everything the 3.0 3D viewer needs: geometry now comes from `DownloadGeometry3DStream`, and GIS layers need `gis:read`. Mint new ones, and share again.

````code-group {#scoped-token}
```javascript
// allowedTasks (third argument) is deprecated: pass null and give the scopes
const result = await client.tokens.createVersionsToken([BIM_WORKS_FIRST_MODEL], 30 * 60,
	null, false, false, ["fs:read", "geometry:read", "query:run"]);
```
```java
// a null task list no longer compiles: the scope overload makes it ambiguous
ObjectNode auth = client.tokens.createVersionsToken(Set.of(UUID.fromString(BIM_WORKS_FIRST_MODEL)), Duration.ofMinutes(30),
		EnumSet.of(Scope.FS_READ, Scope.GEOMETRY_READ, Scope.QUERY_RUN), null, false);
```
```csharp
// the constructors with a task-name list are [Obsolete]
CreateVersionsTokenResponse response = client.Tokens.CreateVersionsToken(new CreateVersionsTokenRequest(
    Collections.CreateHashSet(Guid.Parse(BIM_WORKS_FIRST_MODEL)),
    new HashSet<Scope> { Scope.FS_READ, Scope.GEOMETRY_READ, Scope.QUERY_RUN }, TimeSpan.FromMinutes(30)));
```
````

**Issued tokens are stricter.**
- Tokens from `GenerateQueryToken`, the `Generate…DownloadGeometry…Token` calls and `GenerateUploadModelToTreeToken` hold only for the exact request they sign. Any other request answers `NON_AUTHORIZED_TASK`.
- A token issued from an issued token cannot create credentials (`CREDENTIAL_CREATION_NOT_ALLOWED`).
- An issuer without write rights gets a read-only token.
- A 3D Tiles URL is no longer accepted as an API credential.
- The signed "delegated" input (`delegated` and `hmac` next to a call's input) is gone.

**Logins.**
- After 10 failed logins for a username, or 30 from one IP address, within 15 minutes, even the right password answers `INVALID_LOGIN` until the window passes. API-token logins are throttled per IP address.
- A custom two-factor client must pass the `token` that the password step returns to `Login2Fa`.
- Changing a password signs out the account's other sessions (`SESSION_SIGNED_OUT`).
- A token restricted to IP addresses is checked against the client address the instance resolves through its trusted proxies, not against a raw `X-Forwarded-For`. A refusal is `NON_AUTHORIZED_IP_ADDRESS`.

## Removed and changed calls {#calls}

| Removed in 3.0 | Use instead |
|---|---|
| `Compare`, the JavaScript `client.ifc.compare()` and `POST /ifc/Compare` | [[openapi:CompareModels]] and [[openapi:GetCompareResult]], which return a new result document ([[page:how-to/models/compare-two-versions]]) |
| `Diff`, `StartDiffSession`, `UpdateDiffSession`, `ExportDiffToBcf`, `ExportDiffToCsv`, `ExportDiffToExcel` | The compare calls and [[openapi:ExportCompareResult]] |
| `ListIfcType`, `ListIfcTypes`, `ListAllUsedTypes` | BQL `GET type, COUNT(qid) GROUP BY type` ([[page:reference/bql/types#type]]) |
| `GetIfcEntity` | A BQL query on the object's [[term:qid|qid]] ([[page:reference/bql/where#qid]]) |
| `GetFootprint`, `POST /gis/GetFootprint`, `ListAvailable2DRepresentations`, and `getFootprint` in the JavaScript SDK (with `client.geometry2d`) and the Java SDK (with `Geometry2dApi.FootprintType`) | A BQL `PROJECTION()`, `PROJECTION(MINIMUM_RECTANGLE)` or `SLICE()` query, which every model with 3D geometry answers ([[page:how-to/geo/get-the-footprint]]) |
| `ApplyChangeSet`, `DownloadIfcWithAppliedChangeSet` | A [[term:bul|BUL]] [[term:transaction|transaction]] ([[page:how-to/models/change-a-model-with-bul]]) |
| `FindNodes` (already disabled in 2.x) | `SearchModelsAdvanced` |
| `SvgExport2d` | `ExportSvg`, or `ExportVectorSvg` for a vector drawing ([[page:how-to/rendering/export-a-vector-drawing]]) |

- **Footprints.** `GetFootprint` is gone (the table above): BQL answers the same outline exactly ([[page:how-to/geo/get-the-footprint]]). The CityGML 3 export's `SLICE_0_2D` and `SLICE_300_2D` became `SLICE_2D` with `slice_height_mm`.
- **Cancelling.** `InterruptTask` (`task.terminate()` in the JavaScript client) cancels only a task started with the same credential, the same session or token. In 2.x it cancelled any task for anyone who had its id. A superadmin still cancels any task.
- **Nodes and versions.**
  - `DeleteNodeVersion` deletes only the newest version (`CAN_ONLY_DELETE_LAST_VERSION`).
  - `GetNode`, `DeleteNode`, `DeleteNodeError` and `ListNodeErrors` answer `NODE_NOT_FOUND` for a missing node, where 2.x returned nothing or `true`.
  - `RenameNode` and `MoveNode` refuse a duplicate names.
  - `ListNodes` refuses nodes and versions tokens: use the uuids the token names.
  - Version lists hold versions that were not uploaded. A version's `origin` is `UPLOAD`, `TRANSACTION` (a BUL commit or a geometry edit) or `CONVERSION` ("Convert to IFC4"). "Set georeference" creates one too.
- **Uploads.**
  - The declared `filesize` must match the bytes.
  - `options.force` takes effect: `NEW_MODEL` creates a sibling model.
  - Upload by URL fetches only from public http(s) addresses (`UPLOAD_URL_REFUSED`).
  - A failed upload leaves the node `ERROR` with an error row. In 2.x the node stayed pending without one.
  - The same bytes under another name reuse the processed model.
  - `.ifcxml` checks in like `.ifc`.
  - DWG, LAS and LAZ need the instance to enable them (`INPUT_FILE_TYPE_NOT_ENABLED`), and PLY is refused.
  - A STEP file truncated inside an entity is `CORRUPT_FILE`; IFC4X3_ADD1 is `UNSUPPORTED_SCHEMA`.
  - A raw `POST /upload` needs `Authorization: Bearer <base64 of the auth JSON>`, or it answers 401. The 3.0 SDKs send it ([[page:how-to/models/upload-a-model]]).
- **Errors.** No error code was removed or renumbered, but 3.0 adds codes: `API_TOKEN_EXPIRED`, `NON_AUTHORIZED_SCOPE`, `SESSION_SIGNED_OUT`, `NODE_GONE`, `TASK_LOST_NODE_CHANGED`, `PAYLOAD_TOO_LARGE`, `TOO_MANY_REQUESTS`, `RESULT_TOO_LARGE`, `QUERY_TOO_EXPENSIVE`, `CAN_ONLY_DELETE_LAST_VERSION`, `UPLOAD_URL_REFUSED` and more ([[page:reference/errors]]). Code that handles a fixed list of codes needs the new ones. An error envelope carries a `reference` and every response an `X-Request-Id`: quote them when you report a problem. A response over 256 MiB fails with `PAYLOAD_TOO_LARGE`.

**The OpenAPI** ([[page:api/index]]):
- [[openapi:LoginWithApiToken]] returns the auth object instead of a base64 string, and [[openapi:LoginWithUsernamePassword]] the auth object instead of `{"auth": …}`. Pass `"response_format": "base64"` to get the 2.x string.
- Errors carry their HTTP status (400, 401, 403, 404, …) instead of always 500. A missing bearer token gives 401 with a JSON body instead of an HTML page.
- The document grew from 20 to 96 operations, and its models changed: regenerate a generated client.

## Query languages {#query-languages}

### Stored actions {#stored-actions}

Stored actions are brought to the 3.0 syntax for you. After the first start on your 2.x data, the instance checks every stored query, visualisation, check and sequence, once. One that no longer parses only because of the known syntax changes below (`IN <unit>`, `CS LENGTH`, a name that became a keyword) gets a new version with the 3.0 text, saved by *system* with the comment *Rewritten for BIM.works 3.0* and the changes it made, such as `IN → UNIT; length → "length"`. The 2.x text stays as the version before it: the version history in the Actions tree shows it, runs it and copies it back as a new version ([[page:how-to/using-bimworks/use-the-actions-tree#organise]]). Two things stay yours:

- An action with any other error, also next to known changes, is not touched. Run your actions on a 3.0 test instance and fix what still fails.
- `IN mm` becomes `UNIT mm`, and 3.0 converts where 2.x ignored the clause, so the numbers of such a column change ([below](#bql-parse)). To keep the 2.x numbers, remove the clause.

Queries, visualisations and checks that your application keeps itself are not rewritten: send them to [[openapi:UpgradeSyntax]], up to 1000 in one request, and it answers each in the 3.0 syntax with the changes it made, or with the error that is left ([[page:how-to/query/convert-2x-queries]]). The BQL sections below have the main points; [[page:changelog/v3-0/bql]] has every change that makes a query fail or return something else.

### Queries that no longer parse {#bql-parse}

1. **`IN` → `UNIT` for unit conversion.** The unit clause of a `GET` feature is `UNIT`; `IN` stays the list comparator of `WHERE`. A query with `IN <unit>` no longer parses.

   ```bql {#unit} invalid
   GET quantity.Qto_WallBaseQuantities.Height UNIT mm      // 3.0
   GET quantity.Qto_WallBaseQuantities.Height IN mm        // 2.x, no longer parses
   WHERE quantity.Qto_WallBaseQuantities.Height IN (2000, 3000)  // unchanged: IN as a comparator
   ```

   [[openapi:UpgradeSyntax]] makes this change for you ([above](#stored-actions)); by hand, search and replace `IN` directly before a unit token: `\bIN\s+(mm|cm|dm|m|km|in|ft|yd|mi|mm2|cm2|dm2|m2|km2|in2|ft2|yd2|mi2|ac|mm3|cm3|dm3|m3|in3|ft3|yd3|l|mg|cg|g|kg|dc)\b` → `UNIT $1`. 2.x accepted the clause and **ignored** it, so after the rewrite the values really are converted and the numbers change. The converted value has a smaller leaf, `{type, value, unit}` ([result structure](#bql-results), [[page:reference/bql/unit]]).
2. **About 140 new reserved words.** Lowercase words such as `length`, `area`, `status`, `path`, `item`, `thickness`, `local`, `figure` and `details` are keywords now, so a property, set or alias spelled like one no longer parses. Quote it: `property.*."length"`. `name`, `width` and `height` were reserved already. On top of these, BVL, BCL and BSL reserve `top`, `left`, `right`, `on`, `off`, `none`, `center`, `front`, `back`, `scale`, `template`, `hide` and `dim`, and BCL also `pick`. BCOL and BRL inherit those words.
3. **`CS LENGTH` is `LENGTH`.**
4. **A query sent as a JSON syntax tree** (`"__type": "Bql"`, as the 2.x JavaScript `QueryHelper` built it): send the query text, or build the 3.0 tree ([[page:reference/bql/ast]]).

Syntax errors read `line 1:9: missing EOF at 'WHER'`, up to three per query, and 2.x's silent partial parses of some malformed queries are errors now. A type in mixed case (`type = IfcWall`) was a syntax error and is `UNKNOWN_TYPE` now.

### Different objects selected {#bql-where}

| Condition | 2.x | 3.0 |
|---|---|---|
| `f = null` | objects with an explicit null, which is almost none | every object without a value for `f` |
| `f != null`, a bare `f`, ranges, numeric `IN` | the object's own values | also values the object takes from its [[term:type-object|type object]] |
| `f BETWEEN (a, b)` (now also `BETWEEN a AND b`) | upper bound excluded | both bounds included |
| `f = 300`, `f = 0.3 m`, `f IN (0.3 m, …)` on a quantity | decimals were truncated to whole numbers, unit literals looked up as raw numbers | exact |
| `a > b` between two features | reversed and unit-blind | correct |
| `a = b` between two features | `NOT_IMPLEMENTED` | works |
| a literal in `ft`, `in`, `km`, `l` or `ac` | the unit was dropped | converted |
| `model.discipline != X` | failed | works; a discipline also matches its sub-disciplines |

Filters on quantities therefore return different objects. A number without a unit compares in the canonical unit (mm, m², m³), as before ([[page:reference/bql/where#comparisons]]).

### Grouping and aggregates {#bql-group}

- `GROUP BY a, b` groups by every key. 2.x grouped by the first one only, and took the other keys from an arbitrary member.
- Grouping on a property, a quantity or a related object adds a group without the key, for the objects that have no value. Text keys are grouped case-sensitively.
- `COUNT(f)` counts the objects that have a value of `f`; 2.x counted all of them. `COUNT(qid)` is unchanged.
- Two aggregates of one kind no longer overwrite each other: the second is keyed by its full text (`COUNT(qid)`). A single `COUNT(qid)` keeps the key `COUNT`
- An empty `MIN`, `MAX` or range aggregate gives `{"type": "double", "value": "NaN"}`, a string where 2.x gave ±1.7976931348623157E308. Parse such values defensively.
- A grouped `attribute.X` comes back nested, `{"attribute": {"X": {…}}}`, like an ungrouped one ([[page:reference/bql/group-by#result]]).

### Result structure {#bql-results}

- `AS` names a column and moves no value. An aliased aggregate or computed column is no longer under its alias: `COUNT(qid) AS n` is under `COUNT`, `SUM(quantity.*.NetVolume) AS v` under `SUM(quantity.*.NetVolume)`. Read values by alias through the answer's `columns` (`QueryColumns.byLabel(records)` in JavaScript, `queryWithColumns` in Java, `"columns": true` on the OpenAPI `Query`), or send `alias_keys` / `aliasKeys: true` (`setAliasKeys(true)` in the SDKs) to keep the 2.x placement while you change your code ([[page:changelog/v3-0/bql#results]]).
- A `UNIT` column holds the converted value in a leaf of `{type, value, unit}`, with `type` in lower case and without `name`, `oid`, `symbol` and `classType`. A wildcard is keyed `quantity.*.NetVolume` instead of by the real set name. A requested feature without a value comes back as an explicit `null`.
- `calculated.*` changed most ([model data](#model-data)). Every calculated value gains a `measurement` object, and the full wildcard adds `calculated.details`, about 7 KB per object, so `GET calculated.*` answers grow several times.
- Results over several models come in a stable order; 2.x could return a different page for the same `LIMIT … OFFSET`. `ORDER BY model.*` works now.
- A query needs the `query:run` scope, and running a stored query by its uuid needs read rights on that query. The JSON `BimQuery` of the `Query` task and the Java `BimQuery` class are deprecated: send BQL text.
- The CSV, XLS and XLSX table export was rewritten. It has a header row, aligned columns and the aggregates.

## Checks, visualisations, compare and clash {#checks}

**[[term:bcl|BCL]], [[term:bvl|BVL]] and [[term:bsl|BSL]] parse strictly.** 2.x ran whatever its parser could recover from a definition with a syntax error, so a check with a missing `;` ran partly and silently. 3.0 refuses it with `SYNTAX_ERROR` and a line and column.

**BCL verdicts.**

| Situation | 2.x | 3.0 |
|---|---|---|
| Several `require`s on one select | the last one's verdict won, so an earlier failure was overwritten | the most serious verdict wins |
| A condition that cannot be evaluated | treated as no restriction: every object passed | the run fails with the condition and the reason |
| `check (f = null)` | matched almost nothing | matches every object without the value ([different objects selected](#bql-where)) |
| `CLASHES_WITH` | errors gave no result | runs on the new clash engine; errors and limits fail the run |

- **Results.** A result title shows the prefix, value, unit and postfix of its feature. Object results gain `evaluationResults`, `overlays` and `pick`, and the top level `interaction`, so a strict parser of the result has to accept them. BCF from checks is valid BCF 3.0 ([[page:reference/bcl#results]]).
- **Failures are errors.** `RunCheckSummary`, `DownloadCheckResultsAsBcfDirect`, `ValidateAction` and the OpenAPI check call answer `UNKNOWN_MODEL_CHECK`, `INVALID_CHECK_DEFINITION` (an IDS that does not parse), `SYNTAX_ERROR` (BCL) or `CHECK_ERROR` for a failed run. 2.x answered with an empty success or a 0-byte BCF.
- **`IdsToBcl`** refuses what it cannot convert (`IDS_TO_BCL_CONVERSION_ERROR`). 2.x dropped such facets silently.

**[[term:ids|IDS]] checking was rewritten** and passes all buildingSMART test cases ([[page:explanation/checking-and-ids]]). For the same model and IDS file the outcome changes where:
- an entity facet names a class: it matches that class exactly, so `IFCWALL` no longer includes `IfcWallStandardCase`;
- names (property sets, properties, attributes, materials, classifications) differ in case;
- a pattern relies on `^` or `$`: patterns are XSD regular expressions, which are anchored and treat those characters literally;
- a `dataType` differs: `IFCTEXT` is not `IfcLabel`. Values are compared in SI units;
- an optional facet is present with a wrong value (it fails now), or a property-set pattern matches several sets (each of them must hold the property);
- `partOf`, set patterns or `predefinedType` are used in the applicability, which 2.x ignored.

An invalid IDS or a failed run is an error now. More than 200 000 object results is `RESULT_TOO_LARGE`, and XML entity declarations are refused. Re-run your IDS files and review the outcomes that changed ([[page:how-to/checks/run-an-ids-check-via-the-api]]).

**BVL and BSL.**
- `group (feature) { … }` blocks are applied; 2.x ignored them ([[page:reference/bvl#groups]]).
- A label's text value is no longer quoted inside its string: `"IFCWALL"` instead of `"\"IFCWALL\""`. A missing value is `"value": null` ([[page:reference/bvl#labels]]).
- `ResolveBsl` returns every frame of a sequence as `frames`, each with its label and the actions `ResolveBvl` returns for its script; 2.x answered `{}` for every sequence. `ResolveBvl` and `ResolveBsl` resolve a stored action by `query_uuid` when you may read it; in 2.x neither loaded the stored text ([[page:reference/bsl#where]]).

**Compare and clash.**
- [[term:bcol|BCOL]] was rewritten. A definition says how objects are matched (`match attribute.GlobalId then attribute.Tag;`) and what is compared (`compare (…);`), and the 2.x form `identification: … compare (…)` no longer parses ([[page:reference/bcol]]).
- A clash definition in the 2.x form `{query1, query2}` is refused when it runs or is saved: the format is `clash/1` now. `ImportActions` still takes the old form without a check, so imported clash definitions fail on first use.

**Stored actions.** Nothing is converted at the upgrade.

| Stored as | On 3.0 |
|---|---|
| BQL query | runs, with the changes above; `IN <unit>` and unquoted reserved words fail |
| BCL check, BVL visualisation | runs if it parses strictly and uses no newly reserved words |
| IDS | runs; outcomes change |
| BSL sequence | resolves if it parses strictly; every frame resolves |
| BCOL in the 2.x form, clash in the `{query1, query2}` form | listed, refused when run |
| Viewpoint in the 2.x form (`{position, target, up}`) | kept by the server; the 3.0 web application asks you to store it again |
| Legacy JSON queries and checks | run |

`UpdateAction` keeps every version of an action and refuses to change its type: create a new action instead. `ImportActions` checks the whole file first, then imports all or nothing. `ListActions` leaves a viewpoint's content out (`query_omitted`): read it with `GetAction`.

## Model data and the reindex {#model-data}

**The reindex is the operator's.** A superadmin starts it after the upgrade, and it pauses after every restart until it is resumed. Until a model's turn comes, the model stays `DONE` and is served from its 2.x data:
- `calculated.quantity.volume`, `floorArea` and `perimeter` read `null`, and `WHERE` on them matches nothing;
- the automatic quantities, the validation report and the space index are missing.

Agree with your operator when your models are reindexed, and treat `null` in that window as "not reindexed yet". [[term:qid|Qids]] stay valid across the reindex: object ids are assigned as in 2.x and version ids are untouched ([[page:explanation/identifiers]]).

**Geometry comes from another engine.** 3.0 tessellates with its own Java engine, also during the reindex. Triangle counts, bounding boxes, colours, 2D plans, footprints and clash results all move a little. A few products gain geometry, and a few lose it. The geometry of an `IFCZONE` is an oriented box instead of the union of its spaces.

**[[term:calculated-value|Calculated values]]** ([[page:reference/bql/calculated-values]], [[page:explanation/calculated-quantities]]):

| Value | 2.x | 3.0 |
|---|---|---|
| `calculated.quantity.floorArea` | the unprojected area of the down-facing faces | projected on the plan: smaller under sloped soffits, ramps and roofs |
| `calculated.quantity.perimeter` | a 2D outline | the boundaries of the faces, on far more products (a stair counts every step) |
| project, site, building, storey | placeholders (floor area 1, volume 0) | the totals of their contents |
| zones | the union of their spaces | the total of their contents |
| `calculated.consistency.*` | 11 `contains…` flags and `bwOpenEdges` | `bwOpenEdges` (with a new meaning), `degenerateTriangles`, `manifold`, `orientationConsistent`, `watertight` |
| `maximumInscribedCircle` | in the model's unit, labelled mm | in mm |
| quantities in feet, gallons, pounds, … | as stored, labelled as metric | recognised and converted to a base unit |

**Do not sum calculated quantities over all objects.** Spatial objects now carry the totals of their contents, so such a sum counts everything two or more times. Re-baseline the quantities you report on your own models after the reindex.

- **Type objects.** A value an object takes from its type object counts in `WHERE`. In `GET`, the object's own value wins.
- **Systems.** `IfcDistributionSystem`, `IfcBuildingSystem` and the other system and group types are indexed, so `system.*` is no longer empty for IFC4 MEP models.
- **Disciplines.** There are ten new values: `SPATIAL`, `GEOTECHNICAL`, `BRIDGE`, `ROAD`, `RAILWAY`, `PORTS_AND_WATERWAYS`, `TUNNEL` and `SURVEY` (existing-situation and geodata models), `TIMBER_STRUCTURE` under `STRUCTURAL` and `VERTICAL_TRANSPORT` (lifts, escalators) under `BUILDING_SERVICES`. A filter on a discipline also matches its sub-disciplines (`= HVAC` matches ventilation models), and every IFC check-in suggests a discipline.
- **Georeference.** About one model in seventy has a world coordinate system that is not the identity, and a new upload of such a file gets a different location; the reindex keeps the stored georeference. Grid convergence now rotates 3D Tiles, CityGML, glTF and footprints, by up to 1.6° in the Netherlands. `GetGeoReference` adds `grid_convergence` and `rotation_north`, and `SetGeoReference` needs write rights and `gis:write` ([[page:how-to/geo/get-the-geo-reference]]).
- **Check-ins** do more work by default (validation, automatic quantities, space index, the free-text index, walkable surfaces), so they take longer.

## SDKs {#sdks}

### JavaScript and the 3D viewer {#javascript}

**Packages**
- Pin every `@bimworks/*` and `@sascom/*` package to the instance's version ([[page:how-to/install/javascript]]). The 3.0 3D viewer needs the 3.0 `@bimworks/viewercommon`.
- `@sascom/commonjs` has an `exports` map, so deep imports such as `@sascom/commonjs/www/…` no longer resolve.
- The deep imports into the 3D viewer's own files (the selection visualizations, `cesium/`, `draco_decoder.*`, `viewobjects.js`) are gone; import the classes from the package.
- The `Version` export is [[js:@bimworks/jssdk/BuildVersion|`BuildVersion`]] in jssdk, viewercommon, viewer2d and viewer3d.

**`@bimworks/jssdk`**
- `client.ifc.compare()` is gone: use [[js:@bimworks/jssdk/Ifc#compareModels|`compareModels`]].
- [[js:@bimworks/jssdk/Bim#clashes|`client.bim.clashes()`]] sends BQL text.
- [[js:@bimworks/jssdk/Bim#validateQuery|`bim.validateQuery()`]] resolves `{messages}`.
- [[js:@bimworks/jssdk/Upload#uploadFromUrl|`uploadFromUrl`]] no longer fetches with `no-cors`, so the URL has to allow CORS.
- An answer with an HTTP error status reaches your error handler as the server's error object, not as `Error("HTTP error! Status: …")`. A failed upload rejects instead of hanging.
- The browser's connection retries for ever; after a server restart a waiting call re-attaches or fails with `TASK_LOST_NODE_CHANGED`.
- Every request carries an `X-BIMworks-Client` header; the instance allows it cross-origin.

**`@bimworks/viewercommon`.** [[js:@bimworks/viewercommon/ModelManager#addModels|`ModelManager.addModels`]] and [[js:@bimworks/viewercommon/ModelManager#setModels|`setModels`]] reject with [[js:@bimworks/viewercommon/IncompleteVersionError|`IncompleteVersionError`]] for a version without [[js:@bimworks/jssdk/Version#uuid|`uuid`]] or [[js:@bimworks/jssdk/Version#im_metadata|`im_metadata`]]. Load the full version before you add it: the summaries in a node listing are not enough.

**The 3D viewer.** Its package name and entry point are unchanged, and it still needs WebGL2. The table has the changes that need code; [[page:changelog/v3-0/viewer3d]] has every change, with the 2.x and 3.0 behaviour side by side.

| Change | What to do |
|---|---|
| [[js:@bimworks/viewer3d/MultiSelectMode|`MultiSelectMode`]] is the strings `"SHIFT"` and `"AUTO"`; [[js:@bimworks/viewer3d/WireframeSelectionVisualization|`WireframeSelectionVisualization`]] takes a colour only | Use the strings; drop the thickness |
| `createBox`, `createCylinder`, `createCone`, `createSphere`, `resetCollections`, `startVerticalMove` (never declared) are gone, and so is `bimSurfer` | Use [[js:@bimworks/viewer3d/Viewer3d#overlays|`overlays`]], [[js:@bimworks/viewer3d/Viewer3d#resetResults|`resetResults()`]] and [[js:@bimworks/viewer3d/Viewer3d#startObjectTransform|`startObjectTransform()`]] |
| [[js:@bimworks/viewer3d/SectionPlanes#startTopPlane|`startTopPlane()`]] and the other side starters return `null` when no model is loaded, or when six planes with other normals already cut. The six planes have no fixed slots, there is one plane per normal, and a section box turns into six planes | Find planes with [[js:@bimworks/viewer3d/SectionPlanes#getPlanes|`getPlanes()`]] and [[js:@bimworks/viewer3d/SectionPlane#getStandard|`getStandard()`]] ([[page:how-to/viewer3d/section-planes#list]]) |
| [[js:@bimworks/viewer3d/Viewer3dSettings#rightMouseClick|`rightMouseClick(event, qid)`]] gets a real qid and a pick, also on a touch long-press | Drop workarounds for the internal number 2.x passed ([[page:reference/viewer3d#rightmouseclick]]) |
| [[js:@bimworks/viewer3d/Viewer3d#addModels|`addModels`]] rejects when loading fails; 2.x never settled | Add error handling |
| Geometry comes over an HTTP stream (`fetch`), with WebSocket as fallback | A viewer page on another origin needs the instance to allow it (CORS) |
| GEO mode places models in the browser, on true north and at their elevation | Store GEO-mode viewpoints and measurements again ([[page:how-to/viewer3d/geo-mode]]) |
| [[js:@bimworks/viewer3d/Camera#setViewpoint|`Camera.setViewpoint`]] scales the direction so the orbit target lies at the real distance | Check restored views ([[page:how-to/viewer3d/set-the-camera]]) |
| Annotations hide behind geometry ([[js:@bimworks/viewercommon/Annotation#occlusion|`occlusion: "hide"`]]) | Set [[js:@bimworks/viewercommon/Annotation#occlusion|`occlusion`]] to keep them on top ([[page:how-to/viewer3d/annotations]]) |
| Finished measurements stay editable, so [[js:@bimworks/viewer3d/MeasuringListener#committed|`committed`]] fires again; `toString()` is in metres | Handle repeated [[js:@bimworks/viewer3d/MeasuringListener#committed|`committed`]] events ([[page:how-to/viewer3d/measure]]) |
| Order-independent transparency is on, the background is a gradient, and new default keys: PageUp/PageDown, O, M, Space, Escape | Set [[js:@bimworks/viewer3d/Viewer3dSettings#realtimeSettings|`orderIndependentTransparency: false`]] or a background colour to keep the 2.x look; review your own key handling ([[page:reference/viewer3d/key-bindings]]) |
| A lost WebGL context stops the viewer and calls the engine-failure listeners | Listen for it |

**The 2D viewer.** Left drag rotates the plan and middle drag pans it; in 2.x left drag panned. [[js:@bimworks/viewer2d/Viewer2d#viewFit|`viewFit`]] is asynchronous, and `client` is a getter. [[page:changelog/v3-0/viewer2d]] has every change.

New features that you do not use change nothing; [[page:changelog/v3-0]] lists them.

### Java {#java}

The artifact is `nl.bimbase.bimworks:client` as before. It is Java 17 bytecode and runs on Java 17 and later ([[page:how-to/install/java]]). The table has the changes that need code; [[page:changelog/v3-0/java-sdk]] has every change.

| Change | What to do |
|---|---|
| [[java:nl.bimbase.bimworks.client.apis.TokensApi#createVersionsToken|`createVersionsToken`]], [[java:nl.bimbase.bimworks.client.apis.TokensApi#createNodesToken|`createNodesToken`]] and [[java:nl.bimbase.bimworks.client.apis.TokensApi#createRecursiveNodeToken|`createRecursiveNodeToken`]] have [[java:nl.bimbase.bimworks.client.Scope|`EnumSet<Scope>`]] overloads; passing `null` for the task list no longer compiles, and the task-list form is deprecated | Pass scopes ([scoped token](#scoped-token)) |
| [[java:nl.bimbase.bimworks.client.Task|`Task<T>`]] was rewritten: [[java:nl.bimbase.bimworks.client.Task#get()|`get()`]] completes the `CompletableFuture`; [[java:nl.bimbase.bimworks.client.apis.ModelChecksApi#runChecks|`runChecks`]], [[java:nl.bimbase.bimworks.client.apis.ModelChecksApi#runCheck|`runCheck`]] and [[java:nl.bimbase.bimworks.client.apis.ModelChecksApi#runIdsCheck|`runIdsCheck`]] throw `ExecutionException` where they returned `null` | Recompile (a swapped jar fails with `NoSuchMethodError`); handle the exception |
| Calls that waited 30 seconds wait for the request timeout (10 minutes) | Set a timeout where 30 seconds mattered |
| Exception messages carry the server's message and `[ref …]` | Do not match on the message text |
| [[java:nl.bimbase.bimworks.client.apis.BimApi#validate|`BimApi.validate(String)`]] returns `false` for an invalid query; uploading to an existing name throws [[java:nl.bimbase.bimworks.client.NodeAlreadyExistsException|`NodeAlreadyExistsException`]] | Adapt the callers |
| `Geometry2dType.SLICE_AT_Z_0` and `SLICE_AT_Z_300` are `SLICE` with a height | Use `SLICE` |
| `Operator.evaluate(Number, Number)` is gone; a recompiled call with boxed numbers binds to `evaluate(double, double)`, which compares the other way round | Review every call |
| `TimeUnit` is an enum; `TokenAuth`, `HomeDirTokenAuth` and `NodeClient.login(String, String)` are gone | — |
| `Discipline` has six values more, `InputFileType` has `DWG` | Do not store ordinals |
| [[java:nl.bimbase.bimworks.client.BimQuery|`BimQuery`]] (JSON queries) is deprecated | Send BQL text through [[java:nl.bimbase.bimworks.client.apis.BimApi#query|`client.bim.query(…)`]] |
| The jar no longer brings `jaxb-runtime` 2.3, `javax.activation` and `bctls` with it | Add what you used through them |
| The generated OpenAPI client changed its models (`AuthResult`, `Double`, `Integer`) | Regenerate it ([[page:reference/java#client2]]) |

### .NET {#dotnet}

Upgrade `BIM.works_SDK` to the 3.0 package of your instance ([[page:how-to/install/dotnet]]).  [[page:changelog/v3-0/dotnet-sdk]] has every change, and what the instance answers differently through the SDK.

- **Uploads** send the auth token as a Bearer header, which 3.0 requires. With an older package an upload of a new file fails with HTTP 401, and a large file with a reset connection.
- **Tokens** take an [[dotnet:BIM.works_SDK.Scope|`ISet<Scope>`]] ([[page:reference/dotnet#scopes]]); the constructors with a task-name list are obsolete ([scoped token](#scoped-token)). [[dotnet:BIM.works_SDK.Admin.CreateApiToken(System.Guid,System.String,System.Collections.Generic.ISet{BIM.works_SDK.Scope},System.Nullable{System.DateTime})|`Admin.CreateApiToken(nodeUuid, name, scopes, expiresOn)`]] sets the scopes and the expiry day ([[page:how-to/auth/create-an-api-token]]).
- **[[dotnet:BIM.works_SDK.TreeNodeStatus#INDEXEDING|`TreeNodeStatus.INDEXEDING`]] is [[dotnet:BIM.works_SDK.TreeNodeStatus#INDEXING|`INDEXING`]].** The old name is an obsolete alias of the same value.
- **Errors** ([[page:reference/dotnet#errors]]):
  - an error value the package does not know is a [[dotnet:BIM.works_SDK.BimWorksException|`BimWorksException`]] whose [[dotnet:BIM.works_SDK.BimWorksException#GetEnum|`GetEnum()`]] is `null`, so test [[dotnet:BIM.works_SDK.BimWorksException#GetErrorType|`GetErrorType()`]]. 2.x threw `ArgumentException`, and could leave an asynchronous call waiting for ever;
  - query errors have their own enumeration, [[dotnet:BIM.works_SDK.BimWorksQueryError|`BimWorksQueryError`]];
  - [[dotnet:BIM.works_SDK.BimWorksException#GetReference|`GetReference()`]] names the failed request for support;
  - [[dotnet:BIM.works_SDK.BimWorksClient#Execute|`Execute`]] throws for an HTTP error status, where 2.x returned `null`;
  - after an asynchronous call, await [[dotnet:BIM.works_SDK.AsyncTask#GetTask|`GetTask()`]] and check [[dotnet:BIM.works_SDK.AsyncTask#IsError|`IsError()`]].
- **Parsing** falls back instead of throwing on a value the package does not know: [[dotnet:BIM.works_SDK.Discipline#UNKNOWN|`Discipline.UNKNOWN`]], [[dotnet:BIM.works_SDK.TreeNodeStatus#UNKNOWN|`TreeNodeStatus.UNKNOWN`]]. A viewpoint in an action listing has [[dotnet:BIM.works_SDK.Action#Query|`Query`]] set to `null`.
- **Upload by URL:** set [[dotnet:BIM.works_SDK.UploadBuilder#filename|`filename`]], or the node gets the name `null`.
- **Upload tokens:** tokens from the [[dotnet:BIM.works_SDK.GenerateUploadToken|`GenerateUploadToken`]] class are refused by 3.0, which binds an upload token to the exact request it signs.

### OpenAPI scripts and raw HTTP {#raw-http}

Handle the new login answers and HTTP statuses ([calls](#calls)), send the Bearer header on `POST /upload`, log in before every other call, and regenerate generated clients against the instance's OpenAPI document.

## The web application {#web-application}

For the people who use BIM.works in the browser:

- **End-user mode** is the default below the developer level. It hides API tokens, uuids and node history; an account that cannot switch it off cannot manage API tokens in the web application.
- **The 3D viewer** is the WebGPU viewer in browsers that support it. The developer viewer settings choose the other one ([[page:how-to/viewer3d/choose-the-viewer]]).
- **New layout and menus.**
  - The pane switchers sit in the menu bar, and a node opens a popup instead of a dropdown and a modal.
  - The 3D context menu and the storey and type menus became one object-set menu: Hide is unticking Visible, Isolate is Only, and Hide type is Same types.
  - The section sides moved under "Standard plane", and measuring has a mode bar.
  - "Default" navigation is called "Orbit" ([[page:how-to/using-bimworks/navigate-the-3d-viewer]]).
  - The phone layout applies up to 800 px wide.
- **Removed.** The "with AI" buttons and voice input in the editors are gone ("Edit with AI" opens the chat), and so is the SDK docs panel. Links to 2.x documentation pages do not redirect. Operator `ui.js` scripts that used the removed jQuery, Prism, showdown, Ace, Wicket or YASGUI break.
- **Viewpoints** stored by 2.x have to be stored again; 2.x clash definitions cannot be opened.
- **Signing in.**
  - Sign-in is a card on the front page.
  - Reset links expire after an hour, and the password policy and login throttling are stricter.
  - Editing a 2.x API token gives it a one-month expiry.

## Check

- Every stored action opens and runs on the 3.0 test instance without a parse error. A search of your stored queries for `IN` followed by a unit token finds nothing.
- Your integration's calls, uploads and token creation work with the 3.0 SDKs, and nothing calls the API before logging in.
- After the reindex, the counts, sums and calculated quantities your reports produce match what you expect, and you know which differences from 2.x are corrections.
- Every API token you use has the scopes it needs and an expiry that you track.
