Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Goal B has been realized here; this website you are at right now. Please note that BIMWHALE.js
has additional documention. These docs are intended for those who want to dive into the nitty gritty.
Here are some additional notes regarding TBW
project.
The aim of TBW
is to:
I: Introduce and explain the basics of IFC II: Teach people how to parse an IFC file and retrieve basic information
In more specific terms, the goal of this project is to:
A: Provide a simple and fast IFC parser B: Provide learning resources (documentation, videos, power points) to people within the AEC industry
To clarify, the focus with The BIM Whale Project is to educate people. The code itself and its functionality are secondary.
TBW
consists of three different parts:
A JavaScript module | BIMWHALE.js
Documentation | This website
A SaaS app | www.bimvalen.se
The BIM Whale (Swedish: BIM-valen) is a project about .
The project is is abbreviated as: TBW
(The BIM Whale).
Abbreviation
Meaning
AEC
Architecture, Engineering, and Construction.
BIM
Building Information Modelling
CAD
Computer Aided Design
IFC
Industry Foundation Classes
TBW
The BIM Whale
Parse so-called User Defined IFC Property Sets
from an IFC file.
Parse entity attributes
Parse geometry
Follow the EXPRESS standard
etc. etc.
Industry Foundation Classes (IFC) is a standardized, digital description of a BIM model.
A STEP-File is the file format that IFC uses.
Yes, the code is hand made. The parsing is not derived from an EXPRESS definition.
See for more information.
Again, see for more information.
No, not yet. See open for more info
Our BIM model was created in Revit.
We have created our own IFC export setup. With our custom setup, Revit exports a Property Set
called Custom_Pset. This means that each object (each door, wall, window, etc.) will have a property set called Custom_Pset.
A property set is simply a set of properties
Here's a collection usefull links.
Here are some links related to TBW
project.
Here are some useful links related to IFC.
Here are some useful links related to the Standard for the Exchange of Product model data, STEP.
Welcome to The BIM Whale Project's documentation.
Please note: This website is currently under construction!
What is The BIM Whale Project?
How do I use The BIM Whale (BIMWHALE.js) on my website?
How do I configure The BIM Whale (BIMWHALE.js)?
What is IFC?
We can open our exported IFC file in . Our information that we want to parse is avaible in the tab Custom_Pset.
Use a FileReader
Create a new BIMWHALE
object
Call parseIfcFile()
This is a quick start guide - i.e. this is intended for those who are exprienced in web development. Check out the for a more detailed explanation.
You are now done! If you have understood the snippet above, then head over to . Otherwise, check the for a for a more in-depth explanation.
Goal A, Provide a simple and fast IFC parser, has been realized as BIMWHALE.js
. It is a client-side IFC parser built using TypeScript.
Not sure what TypeScript is? Check out
The TypeScript code has been compiled into regular JavaScript using . That's why it is called BIMWHALE.js
. Check out the pages for more information.
You can download the latest version of BIMWHALE.js
from the content delivery network (CDN) .
Not sure what a CDN is? Check out:
Let's reuse our example in the section.
The first thing we are going to configure is the required entities. These three should do fine.
Notice how the object is structured. The key must be in uppercase. The value can have any form.
There's no need to get all IfcEntities
. Let's specify which entities we want.
Our sample file has only a door and a wall. It would be unnecessary to try to get the roofs, floors, windows, etc.
A list of common Ifc Entites can be found here:
Also, there's no need to get all Property Sets
. Let's specify which we want. Leave the array blank to include all Property Sets
.
Notice how the object is structured.
This is an array, not an object.
Our final config object
is constructed as:
We are looking to retrieve the Property Set
called Custom_Pset.
Custom_Pset occurs five times in our file, see below:
These lines are not in a human-readable form. We cannot interpret this data. BIMWHALE.js will help us retrive and parse this data. Take a very quick at the input/output
then go ahead to the next step.
The can be used to join the two arrays
This example will use the sample file.
Make sure you read the before continuing
Make sure you include TBW before your main function.
Use BIMWHALE.js
. by:
Creating a new BIMWHAlE
object
Calling the method parseIfcFile()
Please note that the config object is missing at this moment.
The final result should look like this:
Please note that this code doesn't output the result. You won't see anything on your screen.
Simply log the IFC Entities like this:
Create a HTML page with an . We'll call our input myFile
.
Get the selected file using a classical DOM selector. See for more information.
Use the to read the content of the IFC file. We will assume that the input is a correct IFC file. In other words, we will assume that the file contains text. That's why we call reader.readAsText(file)
.
The onload
property will handle the actual reading of the file. See for more info. Notice that we .
Congratulations, you are now ready for the .
Let's take a minitue to prettify the result. We can implement this simple function:
Calling this function will give us a prittier result:
Good job! You are now ready for the Advanced Example
The config was hard coded. There was no way for the user to change it.
The infromation was only logged in the console. A regular user couldn't see the result.
Let's build something more practical. Make sure you have read and understood the . Before we begin, let's list some feature that the previous example lacked:
You can check out the final result on , or use the box below.
N.B The website is currently only avaible in Swedish. Once complete, it will get translated into English.
TBW
is also available as a SaaS app. The website consist of three different tools that handles IFC files. It uses behind the scenes.
We will use as the CSS framework.
Regular Bootstrap tables lacks any functionality. will add that.
Both Bootstrap and DataTables require .
We are going to use to extend the select boxes.
Full Source: If you been following this example step by step, you should have something like this:
Good luck with your own project :)
You can check out the final result on , use the box below or see the full source below.
We are going to use Boostrap 4 (not 5).
We'll select both jQuery 3 & Boostrap 4.
And we'll use CDN as our donwload method.
Simply copy the two lines and paste into your HTML.
Our HTML should look something like this:
Let's install our prerequisites. We will use the . DataTable has an excellent documentation if you get stuck. Anyways, go to their download page:
Notice that this example might use outdated links. Go to the and get the latest links.
This might look very complicated, but don't worry.
We simply get our selection by calling $("#selectedEntitesInput").val()
We create an object for each selected entity using.forEach((entity) =>
Our HTML should look something like this:
Let's add an input:
A simple approach to run a function on each file change:
Our HTML should look something like this:
Let's convert the select2 input to something we can use. We are going to use in this example.
We use an . Our emtpy object, selectedEntities
, gets populated.
The covered the bascis of reading a file and using BIMWHALE.js
.
Let's output our result to a table using DataTables.
Our HTML should look something like this:
WIP
Our website should look like this:
The config
object consist of four required properties:
Required Entities
Selected Entities
Selected Property Sets
All Entities
The config
object is passed into BIMWHALE.js's constructor function as a paramter:
Notice that some properties are JavaScript objects as well.
Here's a summary of the properties within the Config
object:
These are the required IFC Entities
. BIMWHALE.js will not work without these.
They are hardcoded into the logic. You should NOT change these.
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.
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.
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.
Leave the array empty to include all Property Sets
We need to populate the table ourselves... this might be a bit tricky to do. Here's an example to help you get started. See for more information.
The IFC sample files are hosted on .
Let's make things a bit prettier. Since we use Boostrap, we will use ther system. First, we wrap everything inside a container.
Then, let's add some . We'll simply add py-2
to each element and a py-4
to the container.
The showed us the easiest way to pass in this object:
All entites are simply requiredEntities
and selectedEntities
combined. The is used to join these objects.
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 }
All entities ( requiredEntities + selectedEntities )
The final thing we need to do is to output the result. With a simple console.log
, we get:
The demo can be found here:
Let's add a select box
above the file input. We will name this selectedEntitesInput.
Our HTML should look something like this:
Let's contiue by allowing the user to select options. Since we already use jQuery, we're going to use as well. Feel free to use any other alternative. We are going to use for this example.
Let's configure select2
. We're going to .
Here's a staring template. Again, a list of IFC building elements can be found .
The Many simple walls sample file can be downloaded from here:
Let's take a look a very basic EXPRESS data model.
We have defined a custom schema called Family
. We have a Person
class within this schema. The person has one attribute: name
. The name is represented as a string.
Schema
Family
Class Name
Person
Class Attribute
Name
Let's take a look at our previous example, the window:
We can see that we each "object" (window, wall, door, roof, etc.) is an ENTITY
. Again, notice how we use the following format to specify an "object":
Here's a list of some common building elements. These are defined in IFC2x Edition 3 Technical Corrigendum 1 schema, SCHEMA IFC2X3;
. Again, notice how each building element ("object") is its own ENTITY
.
Let's go back to our window. This is a Window
class defined using the EXPRESS data model format.
Take a look at line 5 and 6. We can see that we have two attributes:
Overall Height
Overall Width
We can verify this by looking at the STEP-file. This has clearly more than two attributes:
We have 10 different attributes. Notice that we don't understand what any of these attributes mean.
Attribute
Value
#1
2cXV28XOjE6f6irgi0CO$D
#2
#42
#3
M_Fixed:0915 x 1830mm:353953
#4
$
#5
M_Fixed:0915 x 1830mm:353953
#6
#35337
#7
#13061
#8
353953
#9
1830.
#10
914.999999999999999
How does this work? How can we have more than two attributes?
Well, the answer lies within the EXPRESS definition. Take a close look at the 4th line above. We can see that IfcWindow
is an subtype of an IfcBuildingElement
. Here's the EXPRESS data model forIfcBuildingElement
:
Notice how the IfcBuildingElement
itself is a subtype of IfcElement
(see line 25 above). Let's continue down the rabbit hole...
Again, notice how our IfcElement
is a subtype of IfcProduct
(see line 13 above). Let's continue...
Our IfcProduct
is a subtype of IfcObject
(see line 11 above).
Our IfcObject
is a subtype of IfcObjectDefinition
(see line 10 above). Let's continue...
Our IfcObjectDefinition
is a subtype of IfcRoot
(see line 5 above). We are almost done...
Finally, we have reached the end!
We call this behaivor inheritance.
IfcWindow
IfcBuildingElement
IfcProduct
IfcObject
IfcObjectDefinition
IfcRoot
Let's flip this "graph". This will make things a bit easier to explain.
IfcRoot
IfcObjectDefinition
IfcObject
IfcProduct
IfcBuildingElement
IfcWindow
We can see that IfcRoot
has four different attributes; GlobalId, OwnerHistory, Name, Description. The IfcObjectDefinition
will inherit these attributes. This means that the IfcWindow
will inherit these attributes.
The IfcWindow
will inherit all attributes from its parent entities.
If we use inheritance, we can see what each attribute in the STEP-file actually mean:
Inhertited from
Attribute
Value
IfcRoot
GlobalId
2cXV28XOjE6f6irgi0CO$D
IfcRoot
Own
#42
IfcRoot
Name
M_Fixed:0915 x 1830mm:353953
IfcRoot
Description
$
IfcObject
ObectType
M_Fixed:0915 x 1830mm:353953
IfcProduct
ObectPlacement
#35337
IfcProduct
Representation
#13061
IfcElement
Tag
353953
IfcWindow
OverallHeight
1830.
IfcWindow
OverallWidth
914.999999999999999
Editor's note:
I know that this can hard to understand. Please, take a good look at this article. Read it agian, think and reflect about the content.
, or
Let's continue with our Window example. We saw that the windows has two attrbitues. However, according to the , we're missing some attributes:
Or, we can simply look at the inheritance graph in the :
A data schema
An exchange file format structure
The data schema is defined in:
The exchange file formats structure is used for exchanging and sharing the data according to the data schema. The exchange file formats structure is defined in:
Let's try to explain IFC in layman's terms.
identities and semantics
name, machine-readable unique identifier, object type or function
characteristics or attributes
material, color, thermal properties, etc.
relationships
locations, connections, ownership, etc.
abstract concepts
performance, costing, etc.
processes
installation, operations, etc.
people
owners, designers, contractors, suppliers, etc.
Etc.
Whereas the Exchange File Format Structure allows the data described to be transferred from one computer system to another.
In this example we're going to take a look at a window. Please note that this section will simply introduce the data schema and STEP-file. We will explain how these works in detail later.
IFC is an international standard by buildingSMART International. It has two parts;
A data schema, EXPRESS
A file format, STEP-File
In summary:
The data schema, EXPRESS, specifies: How an object should be represented
The file format, STEP-file, specifies: An actual object
Notice that we need both the data schema and the file format to understand our BIM model.
In other words:
The data schema is the manual
The file format is the usage of the manual
In object oriented programming words:
The data schema, EXPRESS, is the class
The file format, STEP-file, is the object
Editor's note:
I know that this can hard to understand. Please, take a good look at this article. Read it agian, think and reflect about the content.
The Basic House sample file can be downloaded from here:
The Large building sample file can be downloaded from here:
The Advanced project sample file can be downloaded from here:
Additional developer resources can be found here:
The Simple wall sample file can be downloaded from here:
The Tall building sample file can be downloaded from here:
The second demo is available here:
Industry Foundation Classes (IFC) is an international standard for Building Information Model (BIM) data . The standard, , is used to exchanged BIM data among software applications used by the various participants in the AEC industry .
IFC is developed and mainteined by buildingSMART International and is used with (. According to , the IFC specifies:
EXPRESS data specification language, ,
Clear text encoding of the exchange structure,
According to (, the IFC data schema describes:
Example: The .IFC file can be used to transfer the BIM model from to
IFC2x Edition 3 Technical Corrigendum 1, or simply , describes a window like this:
To clarify: This is the data schema for a window class. The window is defined using the EXPRESS data specification language ().
The STEP-file, , describes the window object like this:
The website is currently only available in Swedish. You can use in the mean time.
Let's take a look at our Window example.
This lines follows this encoding template:
Instance Name
Entity Name
Attributes
We can express this template in two different ways:
1. Instance Name
=2. Entity name
(3. Attributes
)
We have, in this example:
Name
Value
Instance Name
#13067
Entity Name
IFCWINDOW
Attributes
'2cXV28XOjE6f6irgi0CO$D', #42,'M_Fixed:0915 x 1830mm:353953',
$,
'M_Fixed:0915 x 1830mm',
#35337,
#13061,
'353953',
1830.,
914.999999999999
Here are some basic encoding rules
Name
Description
Instance Name
The instance name must consist of a positive integer. The instance name is only valid locally within the STEP-file.
If the same content is exported again, the instance names may be different.
The instance name is also used to reference other entity instances through attribute values or aggregate members.
The referenced instance may be defined before or after the current instance.
Entity Name
Instances are represented by writing the name of the entity in capital letters and then followed by the attribute values in the defined order within parentheses.
Attributes
Only explicit attributes get mapped
Inverse, Derived and re-declared attributes are not listed since their values can be deduced from the other ones.
Unset attribute values are given as "$".
Multuple values are comma separated
Again, this can be visualized as:
#
Instance Name
=Entity name
(Attributes
)
Or, as our example:
#13067
=IFCWINDOW
('2cXV28X...
)
Or, as a single line:
Mapping of other data types
Example
Enumeration, boolean and logical values are given in capital letters with a leading and trailing do
.TRUE.
Integers and real values are used identical to typical programming languages
123
String values are given in quotes.
"My string"
For characters with a code greater than 126 a special encoding is used. The character sets as defined in ISO 8859 and 10646 are supported.
N/A
The elements of aggregates (SET, BAG, LIST, ARRAY) are given in parentheses, separated by ",".
(1,2,3)
Each entity instance is ended with a semi-colon
;
Editor's note:
I know that this can hard to understand. Please, take a good look at this article. Read it agian, think and reflect about the content.
Work in progress...
buildingSMART, 2020a. Industry Foundation Classes (IFC). [Online] Available at: [Accessed 2020-12-18].
BuildingSMART, 2020b. Industry Foundation Classes (IFC) - An Introduction. [Online] Available at: [Accessed 2020-12-18].
ISO, 2020a. ISO 16739-1:2018. [Online] Available at: [Accessed 2020-12-18].
ISO, 2020b. ISO 16739-1:2018. [Online] Available at: [Accessed 2020-12-18].