bonsai-syntax-elements
Bonsai IFC Element Access Syntax
Version: Bonsai v0.8.4 | Blender 4.2.0+ | Python 3.11 Module path:
bonsai.*— NEVERblenderbim.*Dependencies: bonsai-core-architecture, ifcos-syntax-api
Critical Warnings
- ALWAYS use
bonsai.*imports. NEVER useblenderbim.*— renamed in 2024 (v0.8.0+). - ALWAYS check
IfcStore.get_file()andtool.Ifc.get()forNonebefore any IFC operation. - ALWAYS use
tool.Ifc.get_entity(obj)to get an IFC entity from a Blender object. NEVER readobj.BIMProperties.ifc_definition_idand callmodel.by_id()manually — the tool method handles edge cases. - NEVER assume every Blender object has an IFC entity.
get_entity()returnsNonefor non-IFC objects. - NEVER assume every IFC entity has a Blender object.
get_object()returnsNonefor entities without scene representation. - ALWAYS run element access code inside Blender (
blender --python).bonsai.tool.*depends onbpyand CANNOT run in standalone Python. - NEVER cache IFC entity references across file reloads. Entity instances become stale when the IFC file is reloaded.
- ALWAYS use
tool.Ifc.link(element, obj)to create bidirectional mappings. NEVER manually populateIfcStore.id_maporIfcStore.guid_map.
More from openaec-foundation/computational-design-day-delft-march-2026
blender-core-api
Guides Blender Python API usage including bpy module structure, RNA data access, context system, dependency graph, and operator invocation. Activates when writing bpy scripts, creating Blender addons, or accessing Blender data blocks programmatically.
1blender-syntax-panels
Defines Blender UI panel creation including bpy.types.Panel, draw() method, UILayout API (row/column/box/split), bl_space_type, bl_region_type, bl_category, sub-panels, draw_header, menus, and UIList. Activates when creating custom Blender panels, building addon interfaces, or working with UILayout elements.
1ifcos-syntax-api
Documents the ifcopenshell.api module system with all 30+ API modules, invocation patterns via api.run() and direct module calls, parameter conventions, and module categorization. Activates when creating IFC entities, modifying properties, managing spatial structure, or using any ifcopenshell.api function.
1bonsai-impl-bcf
Guides implementation of BIM Collaboration Format (BCF) workflows in Bonsai including creating BCF topics, adding viewpoints with camera snapshots, managing comments, importing/exporting BCF files (v2.1 and v3.0), and integrating BCF issue tracking with IFC element references. Activates when working with BCF files, BIM issue tracking, clash report management, or collaboration workflows in Bonsai.
1ifcos-impl-mep
Guides MEP (Mechanical, Electrical, Plumbing) modeling in IFC using ifcopenshell.api.system including IfcSystem, IfcDistributionElement, ports, connections, flow segments, fittings, and MEP-specific property sets. Activates when creating HVAC systems, piping networks, electrical circuits, or MEP elements in IFC models.
1ifcos-impl-cost
Guides IFC cost management using ifcopenshell.api.cost including cost schedules, cost items, cost values, cost quantities, and 5D BIM workflows. Activates when implementing cost estimation in IFC models, creating cost schedules, or linking quantities to cost items.
1