Skip to content
jakob-beetz edited this page Dec 20, 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. Even though a regular Python tutorial is strongly recommended, the

Hello world, hello IFC

As a first check, to test whether the setup works, please start the viewer and load a model. Then, type in the words

print ("hello world")

and press the Run button (or press Ctrl+P) which should print out the words hello world to the console window under the editor.

All code in the editor is regular Python code and will be evaluated by the Python interpreter when "Run" is pressed. This means that you can also include other libraries that might not be included in one of the standard modules of the language.

Clone this wiki locally