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...
The BIM Whale (Swedish: BIM-valen) is a project about Industry Foundation Classes (IFC).
The project is is abbreviated as: TBW
(The BIM Whale).
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
TBW
is also available as a SaaS app. The website consist of three different tools that handles IFC files. It uses behind the scenes.
www.bimvalen.se
N.B The website is currently only avaible in Swedish. Once complete, it will get translated into English.
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.
Here are some additional notes regarding TBW
project.
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?
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.
See for more information.
A STEP-File is the file format that IFC uses.
Again, see for more information.
Yes, the code is hand made. The parsing is not derived from an EXPRESS definition.
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.
No, not yet. See open for more info
You can download the latest version of BIMWHALE.js
from the content delivery network (CDN) .
Not sure what a CDN is? Check out:
To get the latest version, simply include this snippet in your HTML:
If you want a specific realase of BIMWHALE.js
, then head to:
Go to the folder dist
and select bundle.min.js
. Notice the dropdown in the picture below. It says 0.0.1
. This indicates which realease you are at.
Abbreviation
Meaning
AEC
Architecture, Engineering, and Construction.
BIM
Building Information Modelling
CAD
Computer Aided Design
IFC
Industry Foundation Classes
TBW
The BIM Whale
This is a quick start guide - i.e. this is intended for those who are exprienced in web development. Check out the detailed instructions for a more detailed explanation.
Use a FileReader
Create a new BIMWHALE
object
Call parseIfcFile()
You are now done! If you have understood the snippet above, then head over to Simple Example. Otherwise, check the Detialed Instructions for a for a more in-depth explanation.
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.
We can open our exported IFC file in Solibri Anywhere. Our information that we want to parse is avaible in the tab Custom_Pset.
A property set is simply a set of properties
This example will use the sample file.
Make sure you read the before continuing
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.
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.
You can check out the final result on , or use the box below.
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:
Create a HTML page with an . We'll call our input myFile
.
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:
Let's reuse our example in the section.
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 final thing we need to do is to output the result. With a simple console.log
, we get:
The can be used to join the two arrays
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 build something more practical. Make sure you have read and understood the Simple Example. Before we begin, let's list some feature that the previous example lacked:
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 convert the select2 input to something we can use. We are going to use spread syntax in this example.
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) =>
We use an arrow function expression. Our emtpy object, selectedEntities
, gets populated.
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 Select2 as well. Feel free to use any other alternative. We are going to use select2@4.0.13 for this example.
Let's add a select box
above the file input. We will name this selectedEntitesInput.
Let's configure select2
. We're going to load our data from an array.
Here's a staring template. Again, a list of IFC building elements can be found here.
Our HTML should look something like this:
Let's output our result to a table using DataTables.
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 Ajax sourced data for more information.
Our HTML should look something like this:
Let's add an input:
A simple approach to run a function on each file change:
The detailed insctructions covered the bascis of reading a file and using BIMWHALE.js
.
Our HTML should look something 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:
The example showed us the easiest way to pass in this object:
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 }
All entities ( requiredEntities + selectedEntities )
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
All entites are simply requiredEntities
and selectedEntities
combined. The spread operator is used to join these objects.
We will use Bootstrap as the CSS framework.
Regular Bootstrap tables lacks any functionality. DataTables will add that.
Both Bootstrap and DataTables require jQuery.
We are going to use select2 to extend the select boxes.
Let's install our prerequisites. We will use the DataTables CDN. DataTable has an excellent documentation if you get stuck. Anyways, go to their download page:
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:
Notice that this example might use outdated links. Go to the DataTables website and get the latest links.
You can check out the final result on Codepen, use the box below or see the full source below.
Full Source: If you been following this example step by step, you should have something like this:
Good luck with your own project :)
WIP
The second demo is available here:
The website is currently only available in Swedish. You can use in the mean time.
The Many simple walls sample file can be downloaded from here:
Make sure you right click, and select "Save as".
The Simple wall sample file can be downloaded from here:
Make sure you right click, and select "Save as".
The demo can be found here:
The Tall building sample file can be downloaded from here:
Make sure you right click, and select "Save as".
The Large building sample file can be downloaded from here:
Make sure you right click, and select "Save as".
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:
Here are some basic encoding rules
Again, this can be visualized as:
#
Instance Name
=Entity name
(Attributes
)
Or, as our example:
#13067
=IFCWINDOW
('2cXV28X...
)
Or, as a single line:
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...
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
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
;
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
buildingSMART, 2020a. Industry Foundation Classes (IFC). [Online] Available at: https://www.buildingsmart.org/standards/bsi-standards/industry-foundation-classes/ [Accessed 2020-12-18].
BuildingSMART, 2020b. Industry Foundation Classes (IFC) - An Introduction. [Online] Available at: https://technical.buildingsmart.org/standards/ifc/ [Accessed 2020-12-18].
ISO, 2020a. ISO 16739-1:2018. [Online] Available at: https://www.iso.org/standard/70303.html [Accessed 2020-12-18].
ISO, 2020b. ISO 16739-1:2018. [Online] Available at: https://www.iso.org/standard/70303.html [Accessed 2020-12-18].
Additional developer resources can be found here:
The Basic House sample file can be downloaded from here:
Make sure you right click, and select "Save as".
The Advanced project sample file can be downloaded from here:
Make sure you right click, and select "Save as".
Industry Foundation Classes (IFC) is an international standard for Building Information Model (BIM) data (buildingSMART, 2020a). The standard, ISO 16739-1, is used to exchanged BIM data among software applications used by the various participants in the AEC industry (ISO, 2020a).
IFC is developed and mainteined by buildingSMART International and is used with openBIM (buildingSMART, 2020b). According to (ISO, 2020a), the IFC specifies:
A data schema
An exchange file format structure
The data schema is defined in:
EXPRESS data specification language, ISO 10303-11,
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:
Clear text encoding of the exchange structure, ISO 10303-21
Let's try to explain IFC in layman's terms.
According to (buildingSMART, 2020b), the IFC data schema describes:
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.
IFC2x Edition 3 Technical Corrigendum 1, or simply IFC2x3, 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 (ISO 10303-11).
This is an abstract representation of a window object. I.e. this window doesn't exist in our building.
The STEP-file, ISO 10303-21, describes the window object like this:
This is an representation of a physical window. I.e. this window exist somewhere in our building.
IFC is an international standard by buildingSMART International. It has two parts;
A data schema, EXPRESS
A file format, STEP-File
Use the tab above to switch between the EXPRESS data schema and the 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.
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.
If you are familiar with object oriented programming, then this should feel very straight forward. If not, check out:
, or
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.
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:
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.
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 :
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
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
Schema
Family
Class Name
Person
Class Attribute
Name