Skip to content
jakob-beetz edited this page Dec 22, 2016 · 14 revisions

IfcOpenShell Scripting Tutorial

Preface and introduction

On these pages small snippets of code are presented that help you to automate tasks working with Industry Foundation Classes models. It is targeted at building domain experts (architects, civil engineers etc.) who have little or no background knowledge in coding. It uses the IfcOpenShell toolkit by Thomas Krijnen. In particular, an interactive viewer is used that allows for quick feedback between the interactions of the scripts with the model by visualizing the results. To get you started, you can download a binary version of the viewer from this location(175 MB!). See the main page for installation instructions.

A regular Python tutorial is strongly recommended. There are many excellent, free resources on the web:

For further examples and documentation of processing IFC files with IfcOpenShell, also refer to the Academy.ifceopenshell.org

If you are looking for challenges to sharpen your skills, here is what students were asked to complete as part of their coursework. :

  1. Mark all external walls of the Duplex_A_20110907.ifc model red
  2. Export all area quantities of the Duplex model to a CSV and open it in Excel
  3. Attach properties to objects (by selection or using all instances of a certain ENTITY (IfcDoor, IfcWall etc.)). Read these properties from a CSV files, that you could e.g. create in Excel

Please feel free to provide feedback and comments.

You can start reading the tutorial here