Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created September 14, 2025 12:47
Show Gist options
  • Select an option

  • Save chuongmep/81c119ed8fef698b4320696d5b9e4e09 to your computer and use it in GitHub Desktop.

Select an option

Save chuongmep/81c119ed8fef698b4320696d5b9e4e09 to your computer and use it in GitHub Desktop.
# %pip install ifcopenshell
# %pip install ifcpatch
import ifcopenshell
# Load an IFC file
ifc_file = ifcopenshell.open("Snowdon Towers Sample Architectural.ifc")
import ifcpatch
from ifcpatch.recipes import Ifc2Sql
# For SQLite
patcher = Ifc2Sql.Patcher(
ifcopenshell.open("Snowdon Towers Sample Architectural.ifc"),
sql_type="SQLite",
database="output.sqlite", # Path to your SQLite database file
# Optional arguments:
# full_schema=True,
# is_strict=False,
# should_expand=True,
# should_get_inverses=True,
# should_get_psets=True,
# should_get_geometry=True,
)
patcher.patch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment