Use when creating, opening, or configuring Bonsai IFC projects -- schema selection (IFC2X3/IFC4/IFC4X3), unit configuration, georeference setup, or project templates. Prevents the common mistake of not setting units before creating geometry (defaulting to incorrect units). Covers the complete project lifecycle from creation to delivery. Keywords: IFC project, schema selection, IFC2X3, IFC4, IFC4X3, units, georeference, coordinate reference system, project template, Bonsai project, CRS, EPSG, WGS84, map coordinates, start new project.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Use when creating, opening, or configuring Bonsai IFC projects -- schema selection (IFC2X3/IFC4/IFC4X3), unit configuration, georeference setup, or project templates. Prevents the common mistake of not setting units before creating geometry (defaulting to incorrect units). Covers the complete project lifecycle from creation to delivery. Keywords: IFC project, schema selection, IFC2X3, IFC4, IFC4X3, units, georeference, coordinate reference system, project template, Bonsai project, CRS, EPSG, WGS84, map coordinates, start new project.
ALWAYS use ifcopenshell.api.project.create_file() to create new IFC projects. NEVER use ifcopenshell.file() directly — it skips required project setup (IfcProject, IfcUnitAssignment, representation contexts).
ALWAYS set units via ifcopenshell.api.unit.assign_unit() immediately after project creation. An IFC file without a unit assignment is invalid per all IFC schemas.
NEVER describe the Bonsai workflow as "import/export". The IFC file IS the native document.
ALWAYS use bonsai.* imports. NEVER use blenderbim.* — renamed in 2024 (v0.8.0+).
ALWAYS check IfcStore.get_file() for None before any IFC operation.
ALWAYS call ifcopenshell.api.georeference.add_georeferencing() before edit_georeferencing(). Editing non-existent entities raises an error.
NEVER set Eastings/Northings without confirmed survey data. Wrong values place the building at the wrong location on Earth.
ALWAYS run scripts via blender --python. NEVER import bonsai.* from system Python.
Schema Selection Decision Tree
Which IFC schema should I use?
|
+--> Legacy project or government mandate for IFC2X3?
| +--> YES --> schema="IFC2X3"
| +--> NO --> Continue
|
+--> Infrastructure project (roads, bridges, tunnels, rail)?
| +--> YES --> schema="IFC4X3"
| +--> NO --> Continue
|
+--> Default for buildings
+--> schema="IFC4"
import ifcopenshell
# Open
model = ifcopenshell.open("/path/to/project.ifc")
# Inspectprint(f"Schema: {model.schema}") # "IFC2X3", "IFC4", "IFC4X3"print(f"Project: {model.by_type('IfcProject')[0].Name}")
# Save (overwrites)
model.write("/path/to/project.ifc")
# Save As (new file)
model.write("/path/to/project_v2.ifc")
Bonsai File I/O (Inside Blender)
import bpy
from bonsai.bim.ifc import IfcStore
# Open
bpy.ops.bim.load_project(filepath="/path/to/project.ifc")
# Access the live IFC model
model = IfcStore.get_file()
if model isNone:
raise RuntimeError("No IFC project loaded")
# Save to current path
bpy.ops.bim.save_project()
# Save As
bpy.ops.bim.save_project(filepath="/path/to/project_v2.ifc")
Unit Configuration
Decision Tree: Unit Selection
What unit system?
|
+--> Metric (international)?
| |
| +--> Architecture/interiors (mm precision)?
| | +--> length: MILLIMETRE
| |
| +--> Urban/site planning (m precision)?
| +--> length: METRE (or no prefix = default SI)
|
+--> Imperial (US/UK)?
|
+--> length: "foot" via add_conversion_based_unit
+--> OR: "inch" for detail work
Does the project need georeferencing?
|
+--> No survey data available?
| +--> Skip georeferencing — add later when data is available
|
+--> Survey data available?
|
+--> Step 1: add_georeferencing()
+--> Step 2: edit_georeferencing() with EPSG code + Eastings/Northings
+--> Step 3 (optional): edit_true_north() for solar analysis
Georeferencing Setup Pattern
import ifcopenshell
import ifcopenshell.api
from math import cos, sin, radians
model = ifcopenshell.api.project.create_file(version="IFC4")
# Step 1: Initialize georeferencing entities
ifcopenshell.api.georeference.add_georeferencing(model)
# Step 2: Configure CRS and map conversion
ifcopenshell.api.georeference.edit_georeferencing(model,
projected_crs={
"Name": "EPSG:28992"# Amersfoort / RD New (Netherlands)
},
coordinate_operation={
"Eastings": 155000.0,
"Northings": 463000.0,
"OrthogonalHeight": 0.0,
"XAxisAbscissa": cos(radians(0.0)),
"XAxisOrdinate": sin(radians(0.0)),
"Scale": 1.0
})
# Step 3 (optional): Set true north for solar analysis
ifcopenshell.api.georeference.edit_true_north(model,
true_north=5.0) # Degrees anticlockwise from Y-axis
Common EPSG Codes for Construction
EPSG Code
Name
Region
EPSG:28992
Amersfoort / RD New
Netherlands
EPSG:32632
WGS 84 / UTM zone 32N
Central Europe
EPSG:32633
WGS 84 / UTM zone 33N
Eastern Europe
EPSG:27700
OSGB 1936 / British National Grid
United Kingdom
EPSG:2154
RGF93 v1 / Lambert-93
France
EPSG:25832
ETRS89 / UTM zone 32N
Germany, Denmark, Austria
EPSG:2056
CH1903+ / LV95
Switzerland
EPSG:3857
WGS 84 / Pseudo-Mercator
Web mapping (NOT for construction)
EPSG:7856
GDA2020 / MGA zone 56
Australia (East)
EPSG:2263
NAD83 / New York Long Island (ftUS)
New York, USA
IFC2X3 Georeferencing (Legacy)
IFC2X3 does NOT have IfcMapConversion or IfcProjectedCRS entities. Instead, georeferencing uses the ePSet_MapConversion property set on IfcProject. The add_georeferencing API handles this automatically — use the same API calls regardless of schema version.