---
title: IfcApi
summary: CLASS in nl.bimbase.bimworks.client.apis.
order: 10
languages: [java]
sdk-package: Java · nl.bimbase.bimworks.client.apis
---

# IfcApi

[[page:reference/java/api|API catalogue]] · `nl.bimbase.bimworks.client.apis` · CLASS

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public class IfcApi
````

IFC related API calls

## Inheritance and interfaces

- [[page:reference/java/nl-bimbase-bimworks-client-apis/subapi-e2929b7e|SubApi]]

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-init-90d2a3ec81bf|IfcApi(BimWorksClient)]] | CONSTRUCTOR |  |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-downloadmodel-d91f177fd357|downloadModel(UUID)]] | METHOD | Download a model, this will return the byte-for-byte original IFC model |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-downloadmodel-e32a8e107a50|downloadModel(UUID, String)]] | METHOD | Download a model converted to another IFC schema. The only supported conversion is IFC2X3 to IFC4; every other one is refused with a message that names the s… |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-downloadmodel-ad29e8cdacfa|downloadModel(UUID, String, boolean)]] | METHOD | As #downloadModel(UUID, String). |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-getschemaconversionreport-4cdacbf98fee|getSchemaConversionReport(UUID, String)]] | METHOD | The log of a schema conversion: what it lost, added and changed. Reads a log, converts nothing: a conversion that was never made is not found. |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-downloaderrormodel-1a5945da343e|downloadErrorModel(UUID)]] | METHOD | Download the IFC model of an Error. This can be useful for debugging. |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-export-9b832d4c5dde|export(Set&lt;UUID&gt;, String)]] | METHOD | Export a new IFC model from one or more models, filtered by the given query. The query should not contain a GET statement, if it does it is ignored. Only sub… |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-downloadifcxml-d6ec6b3a7b0d|downloadIfcXml(UUID)]] | METHOD | The model as ifcXML (generated on first request and cached server-side). The caller closes the stream. |

## `IfcApi(BimWorksClient)` {#member-init-90d2a3ec81bf}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public IfcApi(nl.bimbase.bimworks.client.BimWorksClient bimWorksClient)
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `bimWorksClient` | [[page:reference/java/nl-bimbase-bimworks-client/bimworksclient-a27e861c|BimWorksClient]] |  |

## `downloadModel(UUID)` {#member-downloadmodel-d91f177fd357}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public java.io.InputStream downloadModel(java.util.UUID versionUuid) throws nl.bimbase.bimworks.client.BimWorksException
````

Download a model, this will return the byte-for-byte original IFC model

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `java.util.UUID` | The UUID of the Version to download |

### Returns

An InputStream that can be used to get the content. Responsibility for closing this stream is on the caller.

### Exceptions

- `BimWorksException` — 

## `downloadModel(UUID, String)` {#member-downloadmodel-e32a8e107a50}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public java.io.InputStream downloadModel(java.util.UUID versionUuid, java.lang.String targetSchema) throws nl.bimbase.bimworks.client.BimWorksException
````

Download a model converted to another IFC schema. The only supported conversion is IFC2X3 to
IFC4; every other one is refused with a message that names the supported ones. A target
schema that the model already has is no error: the model is then downloaded as it was
uploaded.

The objects of the converted file have the express ids and the GlobalIds of the model. A
conversion can take minutes for a large model, so this call waits up to 30 minutes; the
converted file is kept on the server, so a second request is answered at once. What the
conversion lost and added is in [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-getschemaconversionreport-4cdacbf98fee|#getSchemaConversionReport(UUID, String)]].

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `java.util.UUID` | The UUID of the Version to download |
| `targetSchema` | `java.lang.String` | The schema to convert to, for example "IFC4" |

### Returns

An InputStream that can be used to get the content. Responsibility for closing this stream is on the caller.

### Exceptions

- `BimWorksException` — 

## `downloadModel(UUID, String, boolean)` {#member-downloadmodel-ad29e8cdacfa}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public java.io.InputStream downloadModel(java.util.UUID versionUuid, java.lang.String targetSchema, boolean validate) throws nl.bimbase.bimworks.client.BimWorksException
````

As [[page:reference/java/nl-bimbase-bimworks-client-apis/ifcapi-11c94b3e#member-downloadmodel-e32a8e107a50|#downloadModel(UUID, String)]].

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `java.util.UUID` |  |
| `targetSchema` | `java.lang.String` |  |
| `validate` | `boolean` | Whether the server holds the converted file against the schema check before it        serves it. This about doubles the time of a conversion. The result of the check is part        of the response of the task, which this method does not return: use the task API for it |

## `getSchemaConversionReport(UUID, String)` {#member-getschemaconversionreport-4cdacbf98fee}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public com.fasterxml.jackson.databind.node.ObjectNode getSchemaConversionReport(java.util.UUID versionUuid, java.lang.String targetSchema) throws nl.bimbase.bimworks.client.BimWorksException
````

The log of a schema conversion: what it lost, added and changed. Reads a log, converts
nothing: a conversion that was never made is not found.

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `java.util.UUID` | A Version that was made by CONVERT SCHEMA, or, with targetSchema, the Version        that was downloaded converted |
| `targetSchema` | `java.lang.String` | Only for a converted download, the schema it was converted to; else null |

### Returns

conversion (the numbers), report (the findings, capped per rule) and detail_log

### Exceptions

- `BimWorksException` — 

## `downloadErrorModel(UUID)` {#member-downloaderrormodel-1a5945da343e}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public java.io.InputStream downloadErrorModel(java.util.UUID errorUuid) throws nl.bimbase.bimworks.client.BimWorksException
````

Download the IFC model of an Error. This can be useful for debugging.

### Parameters

| Name | Type | Description |
|---|---|---|
| `errorUuid` | `java.util.UUID` | The UUID of the Error |

### Returns

An InputStream that can be used to get the content. Responsibility for closing this stream is on the caller.

### Exceptions

- `BimWorksException` — 

## `export(Set<UUID>, String)` {#member-export-9b832d4c5dde}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public java.io.InputStream export(java.util.Set<java.util.UUID> versionUuids, java.lang.String query) throws nl.bimbase.bimworks.client.BimWorksException
````

Export a new IFC model from one or more models, filtered by the given query. The query should not contain a GET statement, if it does it is ignored.
Only subclasses of IfcProduct can be queried. By default all geometric representations are also included in the results.
The decomposes/containment tree all the way up to IfcProject is included for each result.
For IfcProject also the UnitAssignment is always included, as are the OwnerHistory objects, to make it a valid IFC file.

When querying multiple models, it should be expected that the resulting IFC will not be valid. For example it will usually have multiple IfcProject entities.

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuids` | `java.util.Set<java.util.UUID>` | The Version UUIDs of the models to query |
| `query` | `java.lang.String` | The BQL query to filter by |

### Returns

An InputStream, closing the InputStream is the responsibility of the caller

### Exceptions

- `BimWorksException` — 

## `downloadIfcXml(UUID)` {#member-downloadifcxml-d6ec6b3a7b0d}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public java.io.InputStream downloadIfcXml(java.util.UUID versionUuid) throws nl.bimbase.bimworks.client.BimWorksException
````

The model as ifcXML (generated on first request and cached server-side). The caller closes the stream.

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `java.util.UUID` |  |

## Inherited members

- `java.lang.Object#equals(java.lang.Object)`
- `java.lang.Object#toString()`
- `java.lang.Object#wait(long)`
- `java.lang.Object#wait(long,int)`
- `java.lang.Object#wait()`
- `java.lang.Object#finalize()`
- `java.lang.Object#getClass()`
- `java.lang.Object#hashCode()`
- `java.lang.Object#clone()`
- `java.lang.Object#notify()`
- `java.lang.Object#notifyAll()`
- [[page:reference/java/nl-bimbase-bimworks-client-apis/subapi-e2929b7e#member-getbimworksclient-a7cb880c7470|getBimWorksClient()]]
