Skip to content

Instantly share code, notes, and snippets.

View stefkeB's full-sized avatar

stefkeB stefkeB

View GitHub Profile
@stefkeB
stefkeB / extract_materials.py
Created October 28, 2022 16:18
List all materials in an IFC file
import sys
import os
import ifcopenshell
def main():
args = sys.argv
if os.path.isfile(args[1]):
ifc_file = ifcopenshell.open(args[1])
else:
return
@stefkeB
stefkeB / IFCTreeWidget.py
Created May 19, 2020 12:27
IFC Structure and Property Viewer (Python, Qt5, IfcOpenShell)
import sys
import os.path
from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QApplication, QWidget, QVBoxLayout
import ifcopenshell
class Window(QWidget):
def __init__(self):
QWidget.__init__(self)
@stefkeB
stefkeB / IFCOSPrintHierarchy.py
Last active April 17, 2024 03:31
Print IFC Hierarchy using IfcOpenShell and Python
import sys
import ifcopenshell
# Indent
def indent(level):
spacer = '. '
for i in range(level):
print(spacer,end='')
# PropertySet
@stefkeB
stefkeB / PrintHierarchy.pro
Last active March 21, 2022 23:08
IFC Print Hierarchy using IfcOpenShell
## -----------------------------------------------------------------
## qmake project file
##
## Usage: qmake -spec macx-xcode (to generate XCode project)
##
## e.g.
## >> mkdir build && cd build
## >> qmake -spec macx-xcode ../XYZ.pro
## >> open XYZ.xcodeproj/
## -----------------------------------------------------------------