What's actually inside an IFC file
You'll be able to find where any property lives, prove whether it was exported, and tell the author exactly what to fix.
The checker says a wall has no fire rating. The architect says it has. The answer is in the IFC file. Let's open it.
Don’t write code? You never need to. Follow the Practitioner path, skip Under the hood and every Do it in code box. Every exercise is answered by clicking, searching or filling in a form.
Already read STEP files by hand? Skip to One instance, one statement, or try the exercise cold.
Transcript
Monday, 08:10. The delivery arrived. By nine, three people are arguing about it.
On screen: Monday, 08:10 · The delivery arrived. · Three people, three arguments, one file.
The fire engineer: wall W-09 has no fire rating. The architect: it does, it’s in the model. Open the file. W-09’s property set holds two values, and FireRating isn’t one of them.
On screen: The fire engineer vs the architect · W-09: two values. No FireRating.
The coordinator: your house is three kilometres from the site, and a thousand times too big. Six numbers in the file place it on the map. One of them turns millimetres into metres. Skip it, and the house lands three kilometres away.
On screen: The coordinator · Scale 0.001 skipped. · IfcMapConversion turns millimetres into metres. · Site, national grid · Your house? Not here. · Your house · 1000× too big · 3 km.
And of twelve issues from last week’s meeting, five now point at nothing. The walls are still there. Their IDs are new: the export gave them new ones.
On screen: The coordinator’s BCF file · 5 of 12 issues point at nothing. · New export, new GlobalIds.
Each of these arguments ends when someone reads the file. How IFC Works shows you how, in eight short chapters, on a real model you can click. Find out who’s right.
On screen: Find out who’s right. · 8 chapters · a real model you can click · How IFC Works · howifc.works.
Where do you work?
Coordinates, cost codes and guidelines differ by country. Short “Local practice” boxes show how it’s done where you work.
Local practice for: SwitzerlandGermanyAustriaInternational
Click a wall
This is a small house, exported to IFC: 10 walls, 2 doors, 4 windows and a floor slab. Next to it is the file it was exported to. Ignore the text for a moment. Click a wall. (On a phone, tap Open the file first.)
The wall turns marker colour, and so does one row of text. That row is the wall. Click a row and the house shows you what it is. Every element you can see has its row, and by the end of this chapter you’ll be able to read all of them.
Now , the wall with the entrance door. Any BIM viewer shows it with FireRating: REI60. So: where in the file is that REI60?
There’s a name, 'W-01', a long code, and a lot of #s and $s. No FireRating, no REI60. The wall’s properties aren’t in the wall.
So look the other way. Under the selected row in Fig. 1.1, the selection card has a line Pointed at by: the rows that point at W-01. Press List them. One of them is , an IFCRELDEFINESBYPROPERTIES (the file writes class names in capitals; documentation writes IfcRelDefinesByProperties, the relationship that gives an element its properties). Follow it:
#48is a relationship. Its RelatedObjects lists the wall,(#43). Its RelatingPropertyDefinition points at#47.#47is a property set namedPset_WallCommon. Its HasProperties lists 3 properties.#46is one of them:FireRating, with the valueIFCLABEL('REI60').
When a property “disappears” between your authoring tool, the viewer and the checker, it’s somewhere along this chain, or it was never written at all.
Build the chain from W-08 to its fire rating, in the order you follow it: the wall first, the value last. Two lines belong to another wall.
Your answer
Lines Choose a line to add it to your answer.
Answer
#176=IFCWALL('0lvZlsTwr1zR6$WpBfPE1M', #5, 'W-08', $, $, #167, #175, $, .PARTITIONING.); #181=IFCRELDEFINESBYPROPERTIES('3dwVSS2RHAkuXmPFjxOMCr', #5, $, $, ( #176), #180); #180=IFCPROPERTYSET('2kd4eM0on1ouhF$hrVnyZM', #5, 'Pset_WallCommon', $, ( #177, #178, #179)); #179=IFCPROPERTYSINGLEVALUE('FireRating', $, IFCLABEL( 'EI30'), $);
#181 lists W-08 (#176) in RelatedObjects and points at #180, a Pset_WallCommon whose HasProperties includes #179: FireRating EI30. The wall points at none of them: you find the relationship by asking what points at the wall.
Needs JavaScript to check your answer. The answer is below.
In the figure, go to the instance that links W-01 to its property set.
Click it in the figure above.
#48 lists W-01 in RelatedObjects and points at #47 Pset_WallCommon, whose HasProperties includes #46: FireRating = REI60. The wall itself points at none of them.Select W-01, look at Pointed at by in the selection card, and pick the row that is a relationship (its type starts withIFCREL).Answer
#48 · #48 lists W-01 in RelatedObjects and points at #47 Pset_WallCommon, whose HasProperties includes #46: FireRating = REI60. The wall itself points at none of them.
Needs JavaScript to check your answer. The answer is below.
The missing fire rating
Monday morning. The fire engineer’s model checker reports: W-09 · FireRating missing. The architect replies that every wall has a rating. You can now find out who’s right.
in Fig. 1.1, list what points at it, and follow the same chain:
The relationship is there, #199. So is the property set, Pset_WallCommon. But its HasProperties lists only IsExternal and LoadBearing. There is no FireRating to find.
The checker is right. The value never made it into the file, so the fix belongs in the authoring model or its export, not in the checker or the viewer. The usual reasons a value seems to go missing:
- It was empty in the authoring tool. Many exporters leave empty values out, without a trace, just like W-09.
- It sits on the wall’s type (
IfcWallType, linked throughIfcRelDefinesByType). A type is like an entry in the IKEA catalogue: one description, any number of shelves built from it. TheIfcWallis like the shelf standing in your living room. Then the value is in the file, and a checker that only reads the wall’s own sets needs its rule widened. Types are chapter 3. - It went out under another name. Sets whose names start with
Pset_are reserved for buildingSMART’s standard property sets, so checkers look forPset_WallCommon.FireRating. A vendor set with a property calledFire Ratingcarries the information where nobody looks. The real file at the end of this chapter writes it both ways.
And W-09 isn’t the only way a rating can go missing in this house. Task C of the exercise asks you to count every wall without one.
Do it in code: read both walls’ FireRating
IFClite (JavaScript)
The same lookup as a script, with the parser from IFClite, the open-source IFC engine the course’s author created. Save the course model next to it, run npm install @ifc-lite/parser@9.9.0, then node fire-rating.mjs (Node 20 or later). It also reads your own files: node fire-rating.mjs your.ifc "Wall name". extractPropertiesOnDemand takes the walk you just took: it starts at the wall, finds every IfcRelDefinesByProperties that lists it in RelatedObjects, and reads the property sets they point at.
// Where does a wall's FireRating live? (Chapter 1, §2)
// npm install @ifc-lite/parser@9.9.0, save the course model next to this file, then:
// node fire-rating.mjs W-01 and W-09 in the course model
// node fire-rating.mjs your.ifc "Wall name" … any IFC file, any walls
import { readFile } from 'node:fs/promises';
import { IfcParser, extractPropertiesOnDemand } from '@ifc-lite/parser';
const [path = 'tiny-house.en.ifc', ...asked] = process.argv.slice(2);
const names = asked.length ? asked : ['W-01', 'W-09'];
const file = await readFile(path);
const store = await new IfcParser().parseColumnar(new Uint8Array(file).buffer);
// IFC2x3 files (and many IFC4 ones) write most walls as IFCWALLSTANDARDCASE.
const walls = ['IFCWALL', 'IFCWALLSTANDARDCASE'].flatMap((type) => store.entityIndex.byType.get(type) ?? []);
const found = walls.filter((id) => names.includes(store.entities.getName(id)));
if (!walls.length) console.log(`${path} has no IfcWall.`);
else if (!found.length) {
const some = walls.slice(0, 3).map((id) => `"${store.entities.getName(id)}"`).join(', ');
console.log(`No wall named ${names.join(' or ')} among the ${walls.length} walls in ${path}. Names look like ${some}.`);
}
for (const id of found) {
// Follows every IfcRelDefinesByProperties that lists the wall in RelatedObjects.
const common = extractPropertiesOnDemand(store, id).find((set) => set.name === 'Pset_WallCommon');
const rating = common?.properties.find((p) => p.name === 'FireRating');
const others = common?.properties.map((p) => p.name).join(', ');
const missing = !common ? 'no Pset_WallCommon' : others ? `no FireRating, only ${others}` : 'an empty Pset_WallCommon';
console.log(store.entities.getName(id), rating ? rating.value : missing);
}
IfcOpenShell (Python)
The same lookup with IfcOpenShell, the open-source IFC toolkit for Python. Save the course model next to it, run pip install ifcopenshell==0.8.5, then python fire-rating.py (Python 3.10 to 3.14). It also reads your own files: python fire-rating.py your.ifc "Wall name". ifcopenshell.util.element.get_psets takes the walk you just took and returns each property set as a dictionary. should_inherit=False keeps it to the wall’s own sets; chapter 3 explains what it would add otherwise.
# Where does a wall's FireRating live? (Chapter 1, §2)
# pip install ifcopenshell==0.8.5, save the course model next to this file, then:
# python fire-rating.py W-01 and W-09 in the course model
# python fire-rating.py your.ifc "Wall name" … any IFC file, any walls
import sys
import ifcopenshell
import ifcopenshell.util.element
path, *asked = sys.argv[1:] or ['tiny-house.en.ifc']
names = asked or ['W-01', 'W-09']
model = ifcopenshell.open(path)
# by_type includes subtypes, so IFC2x3's IFCWALLSTANDARDCASE walls are in here too.
walls = model.by_type('IfcWall')
found = [wall for wall in walls if wall.Name in names]
if not walls:
print(f'{path} has no IfcWall.')
elif not found:
some = ', '.join(f'"{wall.Name}"' for wall in walls[:3])
print(f'No wall named {" or ".join(names)} among the {len(walls)} walls in {path}. Names look like {some}.')
for wall in found:
# Follows every IfcRelDefinesByProperties that lists the wall in RelatedObjects.
# should_inherit=False: the wall's own sets only, not its type's (that's chapter 3).
psets = ifcopenshell.util.element.get_psets(wall, psets_only=True, should_inherit=False)
common = psets.get('Pset_WallCommon') # {'FireRating': 'REI60', …, 'id': 47}; get_psets adds the set's #id
others = ', '.join(name for name in common or {} if name != 'id')
if common and 'FireRating' in common:
print(wall.Name, common['FireRating'])
else:
print(wall.Name, 'no Pset_WallCommon' if common is None else f'no FireRating, only {others}' if others else 'an empty Pset_WallCommon')
It prints:
W-01 REI60
W-09 no FireRating, only IsExternal, LoadBearingWhere does W-09's fire rating go missing?
W-09 has a relationship and a Pset_WallCommon, like W-01. But HasProperties lists only IsExternal and LoadBearing. The checker is right: the rating was never written.W-09 has a relationship and a Pset_WallCommon, like W-01. But HasProperties lists only IsExternal and LoadBearing. The checker is right: the rating was never written.Answer
Its property set has no FireRating · W-09 has a relationship and a Pset_WallCommon, like W-01. But HasProperties lists only IsExternal and LoadBearing. The checker is right: the rating was never written.
Needs JavaScript to check your answer. The answer is below.
The file proves it: W-09 has no FireRating. The fire engineer needs the rating before the meeting. What do you do next?
Pick one. Then you see what happens with each option.
What happens with each option:
- The checker turns green today, and the next export from the architect brings the gap back. Nobody upstream knows the value was missing, and you've edited a delivery you don't own.
- The fix lands where the gap is, in the authoring model, and it stays fixed in every later export. The GlobalId lets her find the wall in her tool.
- The file has no rating on a type either, so the rule would only hide the gap. The checker was right.
- Fair if many walls are affected and your contract says so. For one missing value it costs a full round of exports, and the architect still has to guess what to fix.
Cause. W-09 has its Pset_WallCommon, but no FireRating in it. The value was empty in the authoring tool, or the exporter never mapped it to Pset_WallCommon.FireRating.
One more to rule out. The same property twice in one set. In a real teaching file, every door’s Pset_DoorCommon held FireRating twice, once as 'None' and once with the class, and three tools counted three different numbers of rated doors, because each read a different copy. Count FireRating per element, not per file: more than one in a set is a mapping fault for the author.
In your tool. Vendor docs and source, checked 8 Nov 2026:
- Revit: Fire Rating is a wall type parameter. The IFC exporter fills
Pset_WallCommon.FireRatingfrom a parameter namedPset_WallCommon.FireRatingorFireRating(on the wall, then on its type), and only then from Fire Rating. Export IFC common property sets must be on (Property Sets tab of the export setup). - Archicad 29: properties reach IFC through the translator’s Property Mapping preset (Map IFC Properties for Export). Graphisoft’s predefined wall mapping covers LoadBearing and IsExternal, not FireRating, so check that a rule maps your fire-resistance property to
Pset_WallCommon.FireRating.
More settings in In your export at the end of section 7.
Ask for it. The rating of every wall in Pset_WallCommon.FireRating, each wall named by its GlobalId.
Exercise: task B
Your own copy of the model, checked instantly. The other tasks wait at the end of the chapter.
Your file as text, with search
Loading your file…
- Task Bfree✓ Solved
Wall … is a fire-compartment wall. What is its FireRating?
The tutor sees this task, your attempts and what you've selected. It asks you questions instead of giving you the answer.
Save your progress
That's a task solved. Add your email to keep your ticks and your place in the course on any device.
Finish this on a bigger screen?
The exercise works best on a laptop. We'll send you the link to this chapter.
Fire ratings and property names
Swiss fire protection follows the fire protection directives of the VKF. They classify building elements by the European standard EN 13501-2, so a wall’s FireRating is a class such as REI 60 or EI 30.
In German, a property is a Merkmal: that’s the term in the Swiss national glossary for digital construction (CRB), with the definition of SN EN ISO 23386. The glossary calls Eigenschaft normatively incorrect.
Sources: VKF, directive 13-15 · CRB, CH glossary
Fire ratings and property names
German building law states fire resistance in words: feuerhemmend, hochfeuerhemmend, feuerbeständig. Annex 4 of the DIBt’s model administrative regulation on technical building rules (MVV TB 2025/1) assigns classes to them: for a load-bearing separating wall REI 30, REI 60 and REI 90, plus the national DIN 4102-2 classes, such as F 90-AB for feuerbeständig. So a German FireRating may hold an EN class, a DIN class or the word: the AIA should say which.
A property is a Merkmal here too: the BIM-Portal des Bundes publishes Merkmale und Merkmalsgruppen for public tenders.
Sources: DIBt, MVV TB 2025/1 · BIM Deutschland, BIM-Portal
Sources linked: researched from primary sources, not yet reviewed by a local practitioner.
Fire ratings and property names
Austria’s fire protection guideline, OIB-Richtlinie 2 (May 2023), states its requirements as classes such as REI 60 or EI 30. Its explanatory notes say the classifications are based on the ÖNORM EN 13501 series.
A property is a Merkmal here too: Austrian Standards publishes the list of BIM properties of the ASI-Merkmalserver (version 1.3.4, May 2024) as a supplement to ÖNORM A 6241-2.
Sources: OIB-RL 2 (2023) · explanatory notes · Austrian Standards, ÖNORM A 6241-2 supplements
Sources linked: researched from primary sources, not yet reviewed by a local practitioner.
Switzerland, Germany and Austria each do this their own way.
It’s just text
You’ve been clicking rows of a file for five minutes. Here’s the whole thing, exactly as it’s stored on disk: about 20 KB of text. Scroll it and watch the house.
There’s no binary data, compression or container format: Notepad shows you the same characters. The house isn’t stored next to the text. The 3D view is drawn from it.
When something goes wrong (a wall loses its fire rating, a model lands in the wrong place, a door turns up twice), the answer is almost always somewhere in this text. (IFC has other encodings too, ifcXML and the compressed ifcZIP. They share one data model, so everything here carries over.)
Before anything else, read the first lines. The HEADER’s FILE_NAME says who exported the file and with which program, and FILE_SCHEMA says which IFC version it is. That’s the fastest answer to “who sent us this, from which tool?”, and the first thing to quote when you write back.
Four parts, always in this order
Under the hood optional if you don't write software or debug exports
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('How IFC Works course model: tiny-house'),'2;1');
FILE_NAME('tiny-house.ifc','2026-11-07T10:00:00',('How IFC Works'),('LTplus AG'),'ifc-lite','ifc-lite','');
FILE_SCHEMA(('IFC4X3_ADD2'));
ENDSEC;
DATA;
#1=IFCPERSON($,$,'',$,$,$,$,$);
…
ENDSEC;
END-ISO-10303-21;
- The start line,
ISO-10303-21;, names the format. IFC borrowed it from STEP, a manufacturing standard (ISO 10303). Its Part 21 knows nothing about walls; it only knows how to write things down. - The HEADER describes the file.
FILE_DESCRIPTIONoften names a model view (the real file at the end of this chapter saysViewDefinition [CoordinationView]; model views are chapter 5).FILE_NAMEholds the file name, a timestamp, the author, the organisation and the program that wrote it. FILE_SCHEMAdecides how every later statement is read.IFC4X3_ADD2is IFC4.3 (ISO 16739-1:2024); older files sayIFC4orIFC2X3. The same text can mean slightly different things under another schema.- The DATA section holds the house, one statement per instance.
ENDSEC;closes each section,END-ISO-10303-21;ends the file.
Go deeper: there’s no rule about order
The first statement in DATA, #1, isn’t the project or a wall. It’s a person: bookkeeping that records who made the file.
Turn on Show editor line numbers in a figure’s Legend and you’ll see more: the storey, #26, sits on line 36, after #27 to #29. A #id is a name, not a position. Ids don’t have to be in order or without gaps, and one statement can run over several lines: readers look for the ; outside quoted text, not the end of the line.
So: how does this wall of text become that house?
This file describes the house in 432 separate statements. How many of them describe something you can actually see? Guess.
Hold that number. Section 6 tells you how close you were.Hold that number. Section 6 tells you how close you were.Needs JavaScript to check your answer. The answer is below.
One instance, one statement
Under the hood optional if you don't write software or debug exports
Each statement describes one entity instance: one particular thing of one particular type. Here’s W-01’s row again.
- GlobalId
'2BdOAw5yj7j9rbgyg3d$jI'· text- OwnerHistory
#5· reference to another instance- Name
'W-01'· text- Description
$· not set- ObjectType
$· not set- ObjectPlacement
#34· reference to another instance- Representation
#42· reference to another instance- Tag
$· not set- PredefinedType
.SOLIDWALL.· enumeration value
#43 is the instance’s name in this file, its #id. IFCWALL is the entity type (documentation writes it IfcWall). Inside the brackets are the attributes, separated by commas, and ; ends the statement.
The attributes have no names
There’s no Name= or GlobalId= anywhere. The file stores only values, in a fixed order, and the schema says which position means what. For IfcWall in IFC4.3 there are nine:
| # | Attribute | In W-01 | What it means here |
|---|---|---|---|
| 1 | GlobalId | '2BdOAw5yj7j9rbgyg3d$jI' |
The wall’s identity across files (section 7) |
| 2 | OwnerHistory | #5 |
Who made it, with which program |
| 3 | Name | 'W-01' |
The name you see in your BIM tool |
| 4 | Description | $ |
Not set |
| 5 | ObjectType | $ |
Not set |
| 6 | ObjectPlacement | #34 |
Where it is (section 5) |
| 7 | Representation | #42 |
What shape it has |
| 8 | Tag | $ |
Not set |
| 9 | PredefinedType | .SOLIDWALL. |
Which kind of wall |
A position never moves. If a value is missing, the comma stays and $ takes its place: not set, no value at all. That’s different from '', which is a text that happens to be empty. And #34 is a reference, a pointer to another instance in the same file.
Go deeper: where the order comes from
IfcWall inherits its attributes. Each level of its family tree adds its own to the end of the list:
| Level | Adds | Positions |
|---|---|---|
IfcRoot |
GlobalId, OwnerHistory, Name, Description | 1 to 4 |
IfcObjectDefinition |
nothing | |
IfcObject |
ObjectType | 5 |
IfcProduct |
ObjectPlacement, Representation | 6 and 7 |
IfcElement |
Tag | 8 |
IfcBuiltElement |
nothing | |
IfcWall |
PredefinedType | 9 |
IfcProduct brings place and shape: everything that can have a position and a geometry is a product. Two levels add nothing the file writes; they group types. (IfcBuiltElement is called IfcBuildingElement in IFC4 and IFC2x3, with the same order. IFC2x3’s IfcWall stops at eight: PredefinedType arrived in IFC4.)
So every door, window and slab shares the first eight attributes with the wall, and a door adds five of its own, starting with OverallHeight and OverallWidth. Everything that descends from IfcRoot (elements, property sets, relationships) starts with GlobalId, OwnerHistory, Name, Description. Learn them once and you can read the start of most statements in any IFC file.
Go deeper: the other kinds of value
'…'is text. Characters outside ASCII are escaped: the German course model’s garden door is'Gartent\X2\00FC\X0\r', where\X2\00FC\X0\is ü (U+00FC)..SOLIDWALL.is an enumeration value, one choice from a fixed list in the schema. Booleans look the same:.T.true,.F.false, and.U.for a logical that is unknown.(…)is a list (or set). Numbers are written plainly; a dot makes a real, so0.is a real and0an integer.IFCLABEL('REI60')is a typed value, a value wrapped in its type. W-01’s fire rating,#46, has four attributes in IFC4.3: Name ('FireRating'), Specification ($), NominalValue and Unit ($). NominalValue accepts many kinds of value (a label is a short text, LoadBearing next to it is anIFCBOOLEAN, a thickness would be anIFCLENGTHMEASURE), so the file has to say which one this is. In IFC4 and IFC2x3 the second attribute is calledDescription, notSpecification: same position, different name, which is whyFILE_SCHEMAcomes first.*marks an attribute a subtype redeclared as derived: its value is calculated, so the file mustn’t write one. This statement has four:
#12=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#11,$,.MODEL_VIEW.,$);Attributes 2 and 3 of IfcPerson are FamilyName and GivenName. Here's the first statement in our file: #1=IFCPERSON($,$,'',$,$,$,$,$); What does it say about the two?
Position 2 is $: no value at all. Position 3 is '': a value, a text with no characters. A checker that only asks whether an attribute is set passes GivenName; one that wants real text fails both, for different reasons.Position 2 is $: no value at all. Position 3 is '': a value, a text with no characters. A checker that only asks whether an attribute is set passes GivenName; one that wants real text fails both, for different reasons.Answer
FamilyName is not set; GivenName is set, to an empty text · Position 2 is $: no value at all. Position 3 is '': a value, a text with no characters. A checker that only asks whether an attribute is set passes GivenName; one that wants real text fails both, for different reasons.
Needs JavaScript to check your answer. The answer is below.
Follow the references
Under the hood optional if you don't write software or debug exports
The wall’s sixth attribute, ObjectPlacement, is #34: not a place, a pointer. Click it, and keep clicking.
#34is anIFCLOCALPLACEMENT. Its second attribute, RelativePlacement, points on to#33.#33is anIFCAXIS2PLACEMENT3D, a little coordinate system. Its Location is a point; Axis and RefDirection say which way is up and which way the wall runs.#30is anIFCCARTESIANPOINT: x, y and z, the origin the wall is drawn from.
Read the trail aloud and it becomes a path: W-01’s ObjectPlacement’s RelativePlacement’s Location. Later chapters write it W-01.ObjectPlacement.RelativePlacement.Location.
Now look at #34’s first attribute, PlacementRelTo. It points at #29, the storey’s placement. So those three numbers aren’t world coordinates; they’re relative to the storey, which is placed relative to something else again. That’s chapter 2. The wall’s shape works the same way: follow Representation, #42, and a few clicks later you reach an extruded rectangle.
So the wall instance itself holds an identity, a name and a type value. Where it is and what shape it has live in other instances it points at, and the relationship that attaches its properties points at it. The references link statements into a graph, so line order doesn’t matter: a reader collects every statement first and resolves the links afterwards.
Do it in code: follow the references
IFClite (JavaScript)
The file has no attribute names, so the script borrows them from the schema, as the table in section 4 did: getAttributeNamesForSchema('IfcWall', 'IFC4X3') returns the nine names in order. A reference comes back as the other instance’s #id, so following one is a lookup. Same setup as before: the course model next to the script, npm install @ifc-lite/parser@9.9.0, node follow-references.mjs (or node follow-references.mjs your.ifc "Wall name").
// Follow W-01's placement to its point, the way the trail does. (Chapter 1, §5)
// npm install @ifc-lite/parser@9.9.0, save the course model next to this file, then:
// node follow-references.mjs W-01 in the course model
// node follow-references.mjs your.ifc "Wall name" any IFC file, any wall
import { readFile } from 'node:fs/promises';
import { IfcParser, getAttributeNamesForSchema } from '@ifc-lite/parser';
const [path = 'tiny-house.en.ifc', name = 'W-01'] = process.argv.slice(2);
const file = await readFile(path);
const store = await new IfcParser().parseColumnar(new Uint8Array(file).buffer);
// The file stores values by position. The schema supplies the names.
function named(id) {
const { type, attributes } = store.getEntity(id);
const names = getAttributeNamesForSchema(type, store.schemaVersion);
return Object.fromEntries(names.map((n, i) => [n, attributes[i]]));
}
const walls = ['IFCWALL', 'IFCWALLSTANDARDCASE'].flatMap((type) => store.entityIndex.byType.get(type) ?? []);
let id = walls.find((w) => named(w).Name === name);
if (!walls.length) console.log(`${path} has no IfcWall.`);
else if (id === undefined) console.log(`No wall named ${name} among the ${walls.length} walls in ${path}.`);
else {
console.log(`#${id} ${store.getEntity(id).type}`);
for (const attribute of ['ObjectPlacement', 'RelativePlacement', 'Location']) {
const next = named(id)[attribute]; // a reference is just the other instance's #id
if (typeof next !== 'number') { console.log(` ›${attribute}› not set here (${store.getEntity(id).type})`); break; }
id = next;
console.log(` ›${attribute}› #${id} ${store.getEntity(id).type}`);
}
if (store.getEntity(id).type === 'IFCCARTESIANPOINT') console.log(JSON.stringify(named(id).Coordinates)); // x, y, z
}
IfcOpenShell (Python)
IfcOpenShell reads the schema for you, so every attribute has its name: wall.ObjectPlacement is the placement instance itself, and following a reference is reading an attribute. is_a() gives the class as the schema writes it (IfcWall); the script prints it the way the file does. Same setup as before: the course model next to the script, pip install ifcopenshell==0.8.5, python follow-references.py (or python follow-references.py your.ifc "Wall name"). Python writes the point as [-0.15, 0.0, 0.0].
# Follow W-01's placement to its point, the way the trail does. (Chapter 1, §5)
# pip install ifcopenshell==0.8.5, save the course model next to this file, then:
# python follow-references.py W-01 in the course model
# python follow-references.py your.ifc "Wall name" any IFC file, any wall
import sys
import ifcopenshell
args = sys.argv[1:]
path = args[0] if len(args) > 0 else 'tiny-house.en.ifc'
name = args[1] if len(args) > 1 else 'W-01'
model = ifcopenshell.open(path)
# The file stores values by position. IfcOpenShell reads the schema and gives them names.
walls = model.by_type('IfcWall') # subtypes too: IFCWALLSTANDARDCASE
element = next((wall for wall in walls if wall.Name == name), None)
if not walls:
print(f'{path} has no IfcWall.')
elif element is None:
print(f'No wall named {name} among the {len(walls)} walls in {path}.')
else:
print(f'#{element.id()} {element.is_a().upper()}') # is_a() is 'IfcWall'; the file writes IFCWALL
for attribute in ['ObjectPlacement', 'RelativePlacement', 'Location']:
target = getattr(element, attribute, None) # a reference comes back as the other instance
if not isinstance(target, ifcopenshell.entity_instance):
print(f' ›{attribute}› not set here ({element.is_a().upper()})')
break
element = target
print(f' ›{attribute}› #{element.id()} {element.is_a().upper()}')
if element.is_a('IfcCartesianPoint'):
print(list(element.Coordinates)) # x, y, z
It prints the trail from Fig. 1.7, then the point’s x, y and z:
#43 IFCWALL
›ObjectPlacement› #34 IFCLOCALPLACEMENT
›RelativePlacement› #33 IFCAXIS2PLACEMENT3D
›Location› #30 IFCCARTESIANPOINT
[-0.15,0,0]Starting at #43, click your way to the point that sets where the wall is.
Click it in the figure above.
#43 ›ObjectPlacement› #34 ›RelativePlacement› #33 ›Location› #30. Read it aloud: W-01's ObjectPlacement's RelativePlacement's Location.#43 ›ObjectPlacement› #34 ›RelativePlacement› #33 ›Location› #30. Read it aloud: W-01's ObjectPlacement's RelativePlacement's Location.Answer
#30 · #43 ›ObjectPlacement› #34 ›RelativePlacement› #33 ›Location› #30. Read it aloud: W-01's ObjectPlacement's RelativePlacement's Location.
Needs JavaScript to check your answer. The answer is below.
Most of the file is helpers
Under the hood optional if you don't write software or debug exports
Back to the figure you started with. It follows two rules. Marker colour means “this line is that element”. Fading means “this line belongs to whatever stays solid”.
- . Its row turns marker colour, and dozens of rows get a pale wash: its placement, shape, properties and openings. The wall isn’t one line. It’s 73.
- . Nothing turns marker colour, because you can’t see a property. Everything else fades and W-01 stays solid: this line belongs to W-01.
- . Now 4 elements stay solid: W-01, Entrance, Window S1, Window S2. The door and windows are placed relative to the wall.
The answer to your guess
Look at the counter under the figure. 17 of the 432 instances are things you can see. The other 415 are helpers: points, directions, profiles, placements, properties, relationships. 117 of them are nothing but points and directions. “IFC is a 3D format” is a misleading way to put it: IFC is a data model that can carry geometry, and here the things you can see are a small minority.
25 of the helpers are relationships, like #48 from section 1. They’re entities in their own right, with their own GlobalId; the standard calls them objectified relationships. Because they’re separate instances, you can attach a property set without rewriting the wall, attach one set to many elements, and find what’s attached to anything by asking what points here?
Go deeper: shared helpers, leftovers and openings
Some helpers are shared. is used by 61 instances (the figure just says Used by the whole model), a single up direction #7 by 24, and the “Body” context #12 by 23. Writing them once and pointing at them keeps the format compact.
Some are used by nothing: . The program that wrote this file adds it every time; it does no harm, and real exports have leftovers too.
Doors and windows sit in openings, IFCOPENINGELEMENT. An opening is a real product with its own shape (the hole the wall loses). This figure doesn’t draw openings, so the counter counts its 6 with the helpers, and so do the project, site, building and storey.
Click any line in the figure that is not visible on its own.
Click it in the figure above.
The chip under the line says what it belongs to. 415 of the 432 instances are like that.The chip under the line says what it belongs to. 415 of the 432 instances are like that.Answer
The chip under the line says what it belongs to. 415 of the 432 instances are like that.
Needs JavaScript to check your answer. The answer is below.
#id vs GlobalId
W-01 has two identifiers: #43 and '2BdOAw5yj7j9rbgyg3d$jI'. Press Re-export under the figure: it writes the same model again, the way a second export might number it, and keeps W-01 selected.
W-01’s #id changed, and so did every other. Its GlobalId, the first value in its row, didn’t. Nothing about the house is different.
A #id only means something inside one file. The program numbers instances as it writes them; the next export may number them differently, and two merged files collide. It isn’t a line number either: W-01 is #43 on line 50.
A GlobalId is meant to survive. It’s a 128-bit identifier written as 22 characters, and case matters (2BdO and 2BDO are different). When a BCF issue, a clash report or a checker’s report needs to point at “this wall”, it should use the GlobalId: “W-09” is only a name, and names repeat.
But a GlobalId stays stable only if the authoring tool keeps it. A deleted and redrawn wall gets a new one. Some exports can regenerate all of them (Archicad, for example, has a setting for it), and copied files can share GlobalIds that should be unique. Checking that is part of model QA (chapter 7).
Go deeper: how 22 characters hold 128 bits
Each character carries 6 bits from a 64-character alphabet: digits, upper- and lower-case letters, _ and $. 22 × 6 is 132, so the first character only carries 2 bits and is always 0, 1, 2 or 3. If you write code: this is not the base64 of RFC 4648. The alphabet is in a different order (0–9 first) and uses _ and $ instead of + and /, so a base64 decoder from the web gives you the wrong UUID. Use your IFC library’s conversion.
You want to find W-01 again in next week's export. What do you store?
The GlobalId is the identity meant to last. #43 and line 50 only mean something inside this one file.The GlobalId is the identity meant to last. #43 and line 50 only mean something inside this one file.Answer
'2BdOAw5yj7j9rbgyg3d$jI' · The GlobalId is the identity meant to last. #43 and line 50 only mean something inside this one file.
Needs JavaScript to check your answer. The answer is below.
In your export: FireRating, the header and GlobalIds
Vendor docs, checked 8 Nov 2026.
-
Revit IFC exporter:
Pset_WallCommon.FireRatingcomes from a parameter namedPset_WallCommon.FireRatingorFireRating(instance first, then type), else from the built-in Fire Rating, a wall type parameter. The set itself needs Export IFC common property sets. Export user defined property sets and Export parameter mapping table map other parameters. -
Archicad 29: Property Mapping preset of the IFC translator, Map IFC Properties for Export, new rules with Add Content. The predefined mapping has no FireRating row.
-
Revit IFC exporter 27.x:
FILE_NAMEnames the Revit build and exporter version. GlobalIds derive from each element’s id; Store the IFC GUID in an element parameter after export saves them in the project. -
Archicad (22 help, the latest that documents the option): Keep ARCHICAD IFC ID keeps GlobalIds between exports; Generate new values writes new ones each time.
-
Tekla Structures 2026:
FILE_NAMEreadsTrimble Inc. - Tekla Structures - <version>; GlobalId can’t be overridden. A model saved under another name gets new identifiers for every object. -
Bonsai 0.9.0: saving writes the IFC itself, “Bonsai” as originating system. Copied elements get new GlobalIds.
In the wild
Our house is tidy on purpose: one storey, one relationship per wall, no types, and fire ratings written the EN 13501-2 way (R for load-bearing capacity, E for integrity, I for insulation, then the minutes). Real exports aren’t tidy. Here’s one from buildingSMART’s community sample collection: the architectural model of a two-storey clinic, written by Revit in 2011, 209,259 instances in 13 MB of text. Download it and open it in any text editor.
Medical-Dental Clinic
Find a wall's FireRating, or prove it's missing.
On a phone this is a large download.
Medical-Dental Clinic, architectural model (Autodesk Revit Architecture 2011, IFC2x3). Source: BSI (2020) "Medical-Dental Test Files," buildingSMART International, https://github.com/buildingsmart-community/Community-Sample-Test-Files/tree/main/IFC%202.3.0.1%20(IFC%202x3)/Medical-Dental%20Clinic. Licence: CC BY 4.0. Changes: none.
Start where a coordinator would: read the header.
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('Project Number','2011-09-06T11:22:43',(''),(''),'Autodesk Revit Architecture 2011 - 1.0','20100326_1700 (Solibri IFC Optimizer)','');
FILE_SCHEMA(('IFC2X3'));
It names the schema, IFC2X3, and the program, 'Autodesk Revit Architecture 2011 - 1.0', and then a second one, '20100326_1700 (Solibri IFC Optimizer)': someone ran the export through an optimizer that merges identical values, so this isn’t the raw Revit export. Who wrote it is left blank: the author fields are just ('').
Then ask section 1’s question. Search for FireRating and skip the placeholders whose “value” is only the property’s name (#57 in Pset_DoorCommon, #107 in Pset_WindowCommon). Here’s the chain of the first wall with a real rating, #346:
#192317=IFCRELDEFINESBYPROPERTIES('3pKZBvl8DBaed6e50etErz',#1,$,$,(#346),#177820);
#177820=IFCPROPERTYSET('1ZXKmsJLL1n9p0uCzGhMNp',#1,'Pset_WallCommon',$,(#251,#23,#24,#14,#252));
#252=IFCPROPERTYSINGLEVALUE('FireRating',$,IFCLABEL('1 HR'),$);
The same chain as W-01’s, with '1 HR' written the US way. Around it, four differences:
- Values get shared too, most likely by the optimizer.
#252,FireRating = '1 HR', is one statement that 30 differentPset_WallCommonsets point at, one per wall. Elsewhere oneIFCRELDEFINESBYPROPERTIESlists 466 walls at once. - Type information is there, but not as
IFCWALLTYPE. The exporter copies each wall type’s properties intoPSet_Revit_Type_…sets linked to every wall of that type, so the rating turns up again as'Fire Rating'(with a space) in'PSet_Revit_Type_Identity Data', shared by 30 walls. Doors get a real type object,IFCDOORSTYLE, IFC2x3’s name for a door type. - Most walls are
IFCWALLSTANDARDCASE, 1,065 of 1,080, as is normal in IFC2x3 and many IFC4 files. - W-09’s case is the rule here: 1,040 of the 1,080 walls have a
Pset_WallCommonwithoutFireRating. Only 40 carry one. Export problem, or walls nobody rated? That’s the next question for the architect.
None of it changes how you read the file: statements, attributes in schema order, references, and relationships that point at what they connect.
You just read your first IFC file
- Properties hang off relationships, not off the element. That’s where W-09’s rating went missing, and where you’d look in any file.
- It’s text: a header, then one statement per instance, attributes in the order the schema sets. Instances point at each other, so the file is a graph, and most of it is helpers.
- Only the GlobalId is meant to last.
The wall knows where it is, relative to something else. Next: why your model sometimes lands 3 km from the site.
Writing code against IFC? The free developer appendix covers the Part 21 grammar, EXPRESS, parsing large files, writing and validating, and compares the open-source libraries.
Read the model
Monday morning. The fire engineer is reviewing the tiny house and has four questions before the coordination meeting. Your copy of the model is attached: its names, values, GlobalIds and every #id were generated for you, so your answers are yours alone. Nothing to install; the file is already open next to these questions.
Your file as text, with search
Loading your file…
- Task Afree✓ Solved
The fire engineer needs to reference the entrance door in a BCF issue. What is the GlobalId of the door named …?
The tutor sees this task, your attempts and what you've selected. It asks you questions instead of giving you the answer.
- Task Bfree✓ Solved
Wall … is a fire-compartment wall. What is its FireRating?
The tutor sees this task, your attempts and what you've selected. It asks you questions instead of giving you the answer.
- Task CPro✓ Solved
The fire engineer suspects some walls were never rated. How many walls have no FireRating value? Count a wall if it has no Pset_WallCommon, or has one without FireRating.
The tutor sees this task, your attempts and what you've selected. It asks you questions instead of giving you the answer.
- Task DPro✓ Solved
The checker's report has reached the architect. She replies: "Which wall, and what exactly should we fix?" The report lists … as FireRating missing. Check … in your file before you answer her. What do you write back?
The tutor sees this task, your attempts and what you've selected. It asks you questions instead of giving you the answer.
What you can do now
Save your progress
That's a task solved. Add your email to keep your ticks and your place in the course on any device.
Finish this on a bigger screen?
The exercise works best on a laptop. We'll send you the link to this chapter.
