ifcos-syntax-api
IfcOpenShell API Module System
Quick Reference
Critical Warnings
- ALWAYS use
ifcopenshell.api.run()or direct module calls for IFC mutations. NEVER modify entity attributes directly (e.g.,wall.Name = "X") — useapi.run("attribute.edit_attributes", ...)instead. - ALWAYS import
ifcopenshell.apibefore calling any API function. The module uses lazy loading; functions are NOT available without this import. - ALWAYS pass the
file(model) object as the first positional argument after the function name inapi.run(). - NEVER invent API module or function names. There are exactly 35 modules — see the module table below. Hallucinated calls like
api.run("element.create", ...)orapi.run("wall.add", ...)do NOT exist. - ALWAYS use keyword arguments for all parameters after the model. Positional arguments beyond the model are NOT supported.
- NEVER use
model.create_entity()for production code. Useapi.run("root.create_entity", ...)— it generates GlobalIds, sets ownership, and validates predefined types automatically. - ALWAYS set up a complete project before creating elements: IfcProject → units → contexts → spatial hierarchy. See the bootstrap pattern below.
- NEVER assume
productsparameters accept single elements. Since IfcOpenShell v0.8+, most relationship functions expectproductsas a list, not a single entity.
Decision Tree: Which API Module to Use
What do you need to do?
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.
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.
1bonsai-impl-qto
Implements Bonsai quantity takeoff (QTO) workflows including calculating quantities from IFC element geometry, using QtoCalculator for automated base quantity computation, managing IfcElementQuantity sets (area, length, volume, weight), custom quantity set definitions, and bulk quantity operations across building elements. Covers the complete QTO pipeline from geometry analysis to quantity export.
1