---
title: Bim
summary: Class in BIM.works_SDK.
order: 10
languages: [csharp]
sdk-package: .NET · BIM.works_SDK
---

# Bim

[[page:reference/dotnet/api|API catalogue]] · `BIM.works_SDK` · Class

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public class Bim : SdkNamespace
````

API Namespace for BIM related API calls

## Inheritance and interfaces

- `System.Object`
- [[page:reference/dotnet/bim-works-sdk/sdknamespace-82399c14|SdkNamespace]]

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/dotnet/bim-works-sdk/bim-bbad6773#member-ctor-d1e172f832f5|Bim(BimWorksClient)]] | Constructor | Creates the BIM query API for a client; normally use BIM.works_SDK.BimWorksClient.Bim. |
| [[page:reference/dotnet/bim-works-sdk/bim-bbad6773#member-processqueryresponse-bf81eb39677c|ProcessQueryResponse(Response)]] | Method | Extracts query records and expands compact qid and IFC-type references. Query and Query2 call this automatically. Applications normally use those methods. |
| [[page:reference/dotnet/bim-works-sdk/bim-bbad6773#member-query-3c27295eff0c|Query(Guid, string)]] | Method | Executes a BQL query on one model version and returns its records. The call blocks until the response arrives. Read array results with JsonElement.EnumerateA… |
| [[page:reference/dotnet/bim-works-sdk/bim-bbad6773#member-query2-654f49b64876|Query2(ISet&lt;Guid&gt;, Guid)]] | Method | Executes a saved query by its UUID across model versions. |
| [[page:reference/dotnet/bim-works-sdk/bim-bbad6773#member-query2-069fdecf369a|Query2(ISet&lt;Guid&gt;, string)]] | Method | Executes a BQL query across a set of model versions. |
| [[page:reference/dotnet/bim-works-sdk/bim-bbad6773#member-query2-00cff8164606|Query2(Guid, Guid)]] | Method | Executes a saved query on one model version. |

## `Bim(BimWorksClient)` {#member-ctor-d1e172f832f5}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public Bim(BimWorksClient bimWorksClient)
````

Creates the BIM query API for a client; normally use [[page:reference/dotnet/bim-works-sdk/bimworksclient-38b8aecc#member-bim-ee1864f07880|BIM.works_SDK.BimWorksClient.Bim]].

### Parameters

| Name | Type | Description |
|---|---|---|
| `bimWorksClient` | [[page:reference/dotnet/bim-works-sdk/bimworksclient-38b8aecc|BimWorksClient]] | The authenticated client that sends requests. |

## `ProcessQueryResponse(Response)` {#member-processqueryresponse-bf81eb39677c}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public JsonElement ProcessQueryResponse(Response response)
````

Extracts query records and expands compact qid and IFC-type references.

Query and Query2 call this automatically. Applications normally use those methods.

### Parameters

| Name | Type | Description |
|---|---|---|
| `response` | [[page:reference/dotnet/bim-works-sdk/response-a3f54d0d|Response]] | A completed query response from the server. |

### Returns

The objects array when present; otherwise the response output unchanged.

## `Query(Guid, string)` {#member-query-3c27295eff0c}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public JsonElement Query(Guid versionUuid, string bimQuery)
````

Executes a BQL query on one model version and returns its records.

The call blocks until the response arrives. Read array results with JsonElement.EnumerateArray(). See [[page:how-to/query/run-a-bql-query|Run a BQL query]] for record examples and [[page:reference/errors|Error codes]] for server errors.

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `System.Guid` | UUID of the model version to read. |
| `bimQuery` | `System.String` | BQL text, for example GET qid, type WHERE type = IFCWALL. |

### Returns

The JSON records. Dotted GET features become nested objects; qids are strings. The shape depends on the query.

### Exceptions

- `BIM.works_SDK.BimWorksException` — The server rejects the query, scope, or model access. Inspect GetEnum(), GetCode(), and Message.

## `Query2(ISet<Guid>, Guid)` {#member-query2-654f49b64876}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public JsonElement Query2(ISet<Guid> versionUuids, Guid queryUuid)
````

Executes a saved query by its UUID across model versions.

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuids` | `System.Collections.Generic.ISet{System.Guid}` | UUIDs of the model versions to read. |
| `queryUuid` | `System.Guid` | UUID of the saved query, rather than BQL text. |

### Returns

The saved query's JSON records, with compact wire data expanded.

### Exceptions

- `BIM.works_SDK.BimWorksException` — The query is unavailable or the server rejects the request or model access.

## `Query2(ISet<Guid>, string)` {#member-query2-069fdecf369a}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public JsonElement Query2(ISet<Guid> versionUuids, string bimQuery)
````

Executes a BQL query across a set of model versions.

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuids` | `System.Collections.Generic.ISet{System.Guid}` | UUIDs of the model versions to read. |
| `bimQuery` | `System.String` | The BQL text to execute against those versions. |

### Returns

The query's JSON records, with compact wire data expanded. The GET columns determine the record shape.

### Exceptions

- `BIM.works_SDK.BimWorksException` — The server rejects the query, scope, or access to a version.

## `Query2(Guid, Guid)` {#member-query2-00cff8164606}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public JsonElement Query2(Guid versionUuid, Guid queryUuid)
````

Executes a saved query on one model version.

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `System.Guid` | UUID of the model version to read. |
| `queryUuid` | `System.Guid` | UUID of the saved query. |

### Returns

The saved query's JSON records.

### Exceptions

- `BIM.works_SDK.BimWorksException` — The server rejects the request, saved query, or model access.

## Inherited members

- [[page:reference/dotnet/bim-works-sdk/sdknamespace-82399c14#member-bimworksclient-1be9291fd000|BimWorksClient]]
- [[page:reference/dotnet/bim-works-sdk/sdknamespace-82399c14#member-execute-c04f7171437b|Execute(Request)]]
- `System.Object.Equals(System.Object)`
- `System.Object.Equals(System.Object,System.Object)`
- `System.Object.GetHashCode`
- `System.Object.GetType`
- `System.Object.MemberwiseClone`
- `System.Object.ReferenceEquals(System.Object,System.Object)`
- `System.Object.ToString`
