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:

new BIMWHALE.file(lines, config);

The example showed us the easiest way to pass in this object:

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:

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.

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.

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:

Notice how the object is structured. The key must be in uppercase. The value can have any form.

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.

var selectedPropertySets = ["Custom_Pset"];

Leave the array empty to include all Property Sets

var selectedPropertySets = [];

All Entities

All entites are simply requiredEntities and selectedEntities combined. The spread operator is used to join these objects.

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

Last updated