---
title: Change a model with BUL
summary: Send BUL statements to CommitTransaction to change property values, move, rotate or delete objects, try them first as a dry run, and get the new version they create.
order: 52
since: 3.0
terms: [bul, transaction, version, qid]
see-also: [reference/bul, how-to/using-bimworks/edit-a-model, how-to/using-bimworks/preview-a-transaction, explanation/nodes-versions-and-the-tree#versions, how-to/models/compare-two-versions]
---

# Change a model with BUL

For an integration that corrects data in bulk — a fire rating for every load-bearing wall, a classification, a renamed room — or that replays edits made elsewhere. A [[term:transaction]] is a list of [[term:bul|BUL]] statements applied to a [[term:version|version]]; the commit creates a new version of the same model node, so the history stays complete and the uploaded file is never touched. The edits the app makes with its move gizmo and the Features panel are the same statements ([[page:how-to/using-bimworks/edit-a-model]]).

## Live demo

```demo
name: model-editing
title: Change the AC11 Institute model with a BUL statement
models: ac11
height: 600
notes: |
  The panel offers a few statements written for this model: a fire rating for the load-bearing walls, a room name, a space category, a classification, a property set of your own, a set removed. Picking one colours the objects its `WHERE` selects. **Dry run** counts what would match and change without committing; **Commit as a new version** creates the version in your Demo folder, and the list of versions under the statement grows by one. **Reset to version 1** deletes every later version again. The demo changes data only; moving and rotating objects is done in the app.
```

## Before you start

- Write rights on the model node, and the UUID of its head version.
- The [[feature:BUL]] feature on the account. Without it, CommitTransaction refuses these statements with 403 `USER_FEATURE_REQUIRED`, dry runs included.
- The statements: `SET` and `DEL` for values, `DELETE OBJECT` and `TRANSFORM` for objects, each over a BQL `WHERE` ([[page:reference/bul#statements]]).

## 1. Try it as a dry run

[[openapi:CommitTransaction]] takes the `version_uuid`, the `bul` statements in order, a `comment` and optionally `dry_run: true`. A dry run resolves the statements and applies them in memory only: it reports per statement how many objects the `WHERE` matches and how many of those would actually change (a `SET` to a value an object already has is matched but not changed), and persists nothing. A dry run works against any version; `is_head` in the response says whether a real commit would be accepted.

```try-it
operation: CommitTransaction
path: /openapi/ifc/CommitTransaction
body: |
  {
    "version_uuid": BIM_WORKS_FIRST_MODEL,
    "bul": ["SET attribute.Name = \"Standard door\" WHERE type = IFCDOOR"],
    "comment": "Normalise door names",
    "dry_run": true
  }
```

### Which objects {#objects}

Add `include_oids: true` to the dry run and every update in the response also names its objects: `matched_oids`, what the `WHERE` selects, and `changed_oids`, those that would end up different — for a `TRANSFORM` also the objects that move with a matched one, for a `DELETE OBJECT` the deleted objects themselves, not what goes with them. `statement_index` numbers the statements from 0, so the assignments of one `SET` share it, and `statement_lines` gives the first and last line of the statement in the `bul` string. Combine each oid with the version UUID to colour the objects in a viewer. Above a server-side limit per model the lists are left out and the response says `oids_truncated`; the counts are always there. The app's transaction preview is built on this ([[page:how-to/using-bimworks/preview-a-transaction]]).

## 2. Commit

Send the same request without `dry_run`. The version must be the head version of its node: history is linear, and a commit against an older version fails with 409. The commit is atomic and synchronous: the statements are applied to the indexed model and its geometry, and when the call returns the node has a new version whose origin is the transaction, with the comment. The response says whether the geometry changed, so a client knows it has to reload the model.

A changed value keeps the IFC type the property had, so a length stays an `IfcPositiveLengthMeasure`; BUL can also name the type, `IFCPOSITIVELENGTHMEASURE(1200 mm)` ([[page:reference/bul#value-types]]). A move or rotation is `TRANSFORM MOVE(x, y, z) ROTATE(AXIS(x, y, z), angle, PIVOT(x, y, z)) WHERE qid …` in world millimetres and degrees ([[page:reference/bul#transform]]).

## Limits

No scaling. Rotation takes exactly one object; moving takes any number. Only the placement changes: the shape of an object is untouched, and an object that shares a placement with an object outside the selection is refused. Moving an object up or down does not re-host it on another storey.

## Check

The dry run reports a match count above zero; after the commit, listing the node's versions ([[page:how-to/models/list-the-tree]]) shows one more, with your comment.
