> For the complete documentation index, see [llms.txt](https://bimwhale.gitbook.io/bim-whale/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bimwhale.gitbook.io/bim-whale/configuration/options.md).

# Config

The `config` object consist of four **required** properties:

1. Required Entities
2. Selected Entities
3. Selected Property Sets
4. All Entities

The `config` object is passed into **BIMWHALE.js**'s constructor function as a paramter:

```javascript
new BIMWHALE.file(lines, config);
```

The [example](/bim-whale/getting-started/example/config.md) showed us the easiest way to pass in this object:

```javascript
var config = {
    requiredEntities:{
        IFCPROPERTYSINGLEVALUE: "IfcPropertySingleValue",
        IFCRELDEFINESBYPROPERTIES: "IfcRelDefinesByProperties",
        IFCPROPERTYSET: "IfcPropertySet",
    },
    selectedEntities:{
        IFCDOOR: "IfcDoor",
        IFCWALLSTANDARDCASE: "IfcWallStandardCase",
    },
    selectedPropertySets: ["Custom_Pset"],
    allEntities:{
          ...requiredEntities,
          ...selectedEntities,
    },
};
var file = document.getElementById('myFile').files[0];
var reader = new FileReader();
reader.onload = function(e) {
    var lines = e.target.result.split(/\r\n|\n/);
    var ifcFile = new BIMWHALE.file(lines, config);
    var ifcEntites = file.parseIfcFile();
};
reader.readAsText(file);
  
```

Notice that some properties are JavaScript objects as well.\
Here's a summary of the properties within the `Config` object:

| Property Name        | Type                       | Description                                                    |
| -------------------- | -------------------------- | -------------------------------------------------------------- |
| requiredEntities     | { \[key: string]: string } | Required IFC entites                                           |
| selectedEntities     | { \[key: string]: string } | Selected IFC entites                                           |
| selectedPropertySets | string\[ ]                 | Selected Property Sets                                         |
| allEntities          | { \[key: string]: string } | <p>All entities<br>( requiredEntities + selectedEntities )</p> |

### Required Entities

These are the required `IFC Entities`. **BIMWHALE.js** will not work without these.\
They are hardcoded into the logic. You should NOT change these.

```javascript
var requiredEntities = {
    IFCPROPERTYSINGLEVALUE: "IfcPropertySingleValue",
    IFCRELDEFINESBYPROPERTIES: "IfcRelDefinesByProperties",
    IFCPROPERTYSET: "IfcPropertySet",
};
```

### Selected Entities

These are the selected `IFC Entities`. There's no need to get all `IFC Entities`.\
For example, an architect may not be intrested in HVAC components.&#x20;

```javascript
var selectedEntities = {
    IFCDOOR: "IfcDoor",
    IFCWALLSTANDARDCASE: "IfcWallStandardCase",
};
```

This requires that you to have a basic understanding of the IFC schema and its entities.\
Here are two major categories:

* [Building Elements](https://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/TC1/HTML/ifcsharedbldgelements/entities.htm)
* [HVAC, Plumbing, Electrical, Fire](https://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/TC1/HTML/ifcsharedbldgserviceelements/entities.htm)

{% hint style="danger" %}
**Notice how the object is structured.**\
\
The **key** must be in uppercase. The **value** can have any form.
{% endhint %}

### Selected Property Sets

These are the selected `Property Sets`. Again, there's no need to get all `Property Sets`.\
Please notice that the logic is case senstive. The name must match exactly.

```javascript
var selectedPropertySets = ["Custom_Pset"];
```

Leave the array empty to include all `Property Sets`

```javascript
var selectedPropertySets = [];
```

### All Entities

All entites are simply `requiredEntities` and `selectedEntities` combined. The [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) is used to join these objects.

```javascript
var allEntities = {
    ...requiredEntities,
    ...selectedEntities,
};
```
