Importing libraries for specific Python versions

That is great. based in this I was able to run the “Hello World” IFC example:

#! python3
import ifcopenshell

import rhinoscriptsyntax as rs
import scriptcontext as sc
import math

import System
import System.Collections.Generic
import Rhino

print(ifcopenshell.version)
model = ifcopenshell.open("D:/userfiles/downloads/AC20-FZK-Haus.ifc")

print(model.schema) # May return IFC2X3, IFC4, or IFC4X3.

print(model.by_id(1))

# print(model.by_guid('0EI0MSHbX9gg8Fxwar7lL8'))

walls = model.by_type('IfcWall')
print(len(walls))

wall = model.by_type('IfcWall')[0]
print(wall.id())

print(wall.is_a()) # Returns 'IfcWall'

print(wall[0]) # The first attribute is the GlobalId
print(wall[2]) # The third attribute is the Name

Terminal:

v0.7.0-eaa2aa05a
IFC4
#1=IfcPerson($,'Nicht definiert',$,$,$,$,$,$)
13
15042
IfcWallStandardCase
2XPyKWY018sA1ygZKgQPtU
Wand-Int-ERDG-4
1 Like