#https://wiki.osarch.org/index.php?title=BlenderBIM_Add-on/Using_the_Python_console_with_BlenderBIM_Add-on import ifcopenshell import ifcopenshell.geom # Initialize the geometry settings settings = ifcopenshell.geom.settings() settings.set(settings.USE_WORLD_COORDS, True) import bonsai.tool as tool ifc = tool.Ifc.get() #https://wiki.osarch.org/index.php?title=IfcOpenShell_code_examples print(ifc.schema) # May return IFC2X3 or IFC4 spaces = ifc.by_type('IfcSpace') print(len(spaces)) for space in spaces[:1]: print(space.Name, space.LongName, space.PredefinedType) boundaries = space.BoundedBy for boundary in boundaries[:1]: print(f"boundarytype {boundary.PhysicalOrVirtualBoundary}") connection_geometry = boundary.ConnectionGeometry shape = ifcopenshell.geom.create_shape(settings, connection_geometry) d = shape.__dict__ l = len(d) print(f"{l} shape attributes:") for k in d: print(k,d[k]) print(dir(shape)) #this gives an error, since this shape object has no geometry attribute faces = shape.geometry.faces