felixkarevo/construction-skills/ifcopenshell-bim-authoring

Claude Code and agent skill by felixkarevo/construction-skills

Trust tier 2
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Native IFC authoring without a CAD host: build discipline models (ARC, TWP, HLS, ELT) directly as IFC files with IfcOpenShell's Python API (`ifcopenshell.api.*`) — headless in a script, or driven by an LLM agent through the `ifcmcp` MCP server. Covers install and versions (IfcOpenShell 0.9.x), the IFC object model an author must get right (units, representation contexts, spatial tree, placements, types, material layer sets, Psets/Qtos, voids and fillings, distribution systems and ports), verifi…

Install

npx vskill@latest install felixkarevo/construction-skills/ifcopenshell-bim-authoring

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as felixkarevo/construction-skills/ifcopenshell-bim-authoring.

IfcOpenShell BIM Authoring — Native IFC, Script- or MCP-Driven

Simple-first gate (governs how this skill is applied). Default every choice here to
the simplest proven solution at the agreed standard tier — see the governing skill
simple-first-building (complexity ladder §1). Escalate to more demanding construction
only when the client explicitly asks for it, with cost/schedule impact stated;
deviate below the usual standard or the aarRdT only via the documented
risk-acceptance machinery (simple-first-building §3).

This skill is the sibling of `construction-freecad-bim`. Both produce BIM models; they differ in where the model lives:

construction-freecad-bimthis skill
Source of truthFreeCAD document (.FCStd), IFC is an exportthe .ifc file itself — no export step, nothing lost in translation
Driverlive FreeCAD GUI via neka-nat/freecad-mcpPython script (ifcopenshell.api) or the ifcmcp MCP server, headless
Strengthsparametric Arch objects, rebar, CalculiX FEM in the same sessionexact IFC semantics (entity, PredefinedType, Psets, systems), per-discipline files, CI-friendly, no GUI hangs
Weak atPset/type fidelity on export, large models, discipline splitinteractive look-and-feel (you need a separate viewer), FEM (hand off)

Both feed the same downstream chain: ifc-model-validation proves the file, bim-management owns the process (LOIN, naming, CDE, BCF).

Markers: [verified 0.9.0] = executed in this skill's test run against ifcopenshell 0.9.0 (PyPI, Python 3.12), with the printed result shown — evidence. [docs] = taken from docs.ifcopenshell.org or the IfcOpenShell source, not re-run here. `VERIFY` = version-, release- or availability-sensitive; check before relying on it.

Reality Check — what this skill's output is

  • An IFC file written by this workflow is a coordination and information model, not

an engineering design. Wall thicknesses, slab depths and pipe diameters come from the owning skills (structural-analysis, masonry-construction, building-services-tga, building-physics-thermal-moisture, …) — never invent them in a modeling recipe.

  • A schema-valid file is not a correct building. §5 shows a wall with no geometry at

all passing ifcopenshell.validate with zero errors. Validity, information completeness (IDS) and design correctness are three separate claims; state which one you checked.

  • A property value such as FireRating = "REI 90" is a claim written into the file,

not a fire-resistance proof. It must be traceable to fire-protection-building and, for a real project, to the signed fire-safety concept.

  • Nothing produced here is construction-ready. A licensed architect/engineer signs off;

site data (Baugrundgutachten, current B-Plan, current GEG/DIN edition) overrides generic values. Say so unprompted when the user's language treats a model as final.

1. Setup

1.1 Library [verified 0.9.0]
bash
python -m venv .venv && . .venv/bin/activate # or: uv venv && uv pip install ...
pip install ifcopenshell # 0.9.0 (PyPI, 2026-09-29) — VERIFY current; Python >=3.10
pip install ifctester ifcpatch ifcdiff ifc5d # separate PyPI packages, same version line
pip install pytest # needed only for `validate --rules` (see G-07)

IfcConvert (IFC → glb/obj/svg/stp/xeokit json) is not in the pip wheel; it ships with the conda package (conda install -c conda-forge ifcopenshell) or as a standalone download [docs: docs.ifcopenshell.org/ifcconvert.html].

ifcopenshell.version prints the installed version. Supported schemas for project.create_file(version=...): "IFC2X3", "IFC4" (default), "IFC4X3". Default to IFC4 for buildings (bim-management §8 for the version decision); IFC2X3 only if a receiving tool demands it, IFC4X3 for infrastructure/alignment work.

API modules shipped in 0.9.0 [verified 0.9.0]: aggregate alignment attribute boundary classification cogo constraint context control cost document drawing feature geometry georeference grid group layer library material nest owner profile project pset pset_template resource root sequence spatial structural style system type unit.

1.2 The ifcmcp MCP server — VERIFY status

ifcmcp is the IfcOpenShell project's own MCP server (source src/ifcmcp, LGPL-3.0+). It wraps the ifcquery (read) and ifcedit (write) command-line tools and keeps one model loaded in memory across tool calls; nothing is written until ifc_save.

Install name trap: the docs page says pip install 'ifcmcp[mcp]', but no ifcmcp package exists on PyPI. The released package is `ifcopenshell-mcp` (0.9.0) [verified 0.9.0]:

bash
pip install 'ifcopenshell-mcp[mcp]' # installs console scripts: ifcmcp, ifcquery, ifcedit
claude mcp add --transport stdio ifc -- ifcmcp # Claude Code

Generic MCP client config (.mcp.json or equivalent):

json
{ "mcpServers": { "ifc": { "type": "stdio", "command": "ifcmcp" } } }

Use the absolute path to the venv's ifcmcp if the client does not inherit the venv. The mcp extra is pinned <2 (mcp 2.0 renamed FastMCP) [docs/source].

Community alternative with a GUI: Bonsai MCP (JotaDeRodriguez/Bonsai_mcp, fork of BlenderMCP) drives Blender + Bonsai over a socket, so the model updates visibly while the agent works. Smaller project, not maintained by IfcOpenShell — VERIFY activity.

Agent rule: whichever bridge, the API semantics in §2–§4 are the same — ifcedit and the Bonsai tools call ifcopenshell.api underneath. Learn the API, then use the bridge as the transport.

1.3 A viewer for inspection

The agent writes files; a human must look at them. Recommended:

  • Bonsai (Blender add-on, IfcOpenShell team) — native IFC, loads several discipline

files side by side, spreadsheet/Pset inspection, clash, IDS, BCF. Largest open-source BIM community (OSArch).

  • Bonsai Viewer — standalone C++/Qt6/WebGPU viewer from IfcOpenShell, early builds

since 2026 — VERIFY maturity before recommending it as the main tool.

  • Browser: That Open Engine (MIT, web-ifc MPL-2.0) or xeokit (AGPL-3.0) when

building your own web viewer.

  • FreeCAD (NativeIFC) opens the files too — convenient if it is already installed.

2. The IFC object model an author must get right

2.1 Use the API, not raw entity creation

f.create_entity("IfcWall", ...) / f.createIfcWall(...) writes a bare instance and nothing else. ifcopenshell.api.root.create_entity(f, ifc_class="IfcWall") also creates the GlobalId, owner history where the schema needs it (IFC2X3), and keeps the relationship graph consistent. Author with `ifcopenshell.api.*`; reserve `f.create_entity` for geometry primitives the API has no function for.

Call style: ifcopenshell.api.root.create_entity(f, ifc_class="IfcWall"). The older ifcopenshell.api.run("root.create_entity", f, ...) still exists in 0.9.0 but its docstring says it is deprecated and will be removed — don't write new code with it. Import every submodule you use (G-01).

2.2 The minimum skeleton — nothing renders without it

Every authored file needs, in this order:

  1. IfcProject (exactly one per file).
  2. Units — unit.assign_unit. Pick one length unit for the project and stay in it

(§2.6). assign_unit(f) with no arguments gives millimetres — a testing convenience per the docs, not a neutral default.

  1. Representation contexts — a Model context and a Body sub-context

(target_view="MODEL_VIEW"). Geometry assigned without a Body context is invisible to most viewers. Add Axis (GRAPH_VIEW) for wall/beam axes, Plan contexts only if you author 2D symbols.

  1. Spatial tree — IfcSite → IfcBuilding → IfcBuildingStorey (→ IfcSpace)

joined with aggregate.assign_object.

  1. Placements on every spatial element (geometry.edit_object_placement), storey

placement z = storey elevation, plus the Elevation attribute set to the same value.

  1. Elements contained in exactly one storey (spatial.assign_container). Elements

that span storeys (stair cores, façades) are contained in one and referenced in the others (spatial.reference_structure).

2.3 Aggregation vs containment vs reference
RelationshipAPIUse for
IfcRelAggregatesaggregate.assign_objectspatial decomposition (Site→Building→Storey→Space) and assemblies (element made of parts)
IfcRelContainedInSpatialStructurespatial.assign_containerphysical element lives on a storey — one container only
IfcRelReferencedInSpatialStructurespatial.reference_structureelement also relevant to other storeys
IfcRelVoidsElementfeature.add_featureopening cuts a wall/slab
IfcRelFillsElementfeature.add_fillingwindow/door sits in the opening
IfcRelDefinesByTypetype.assign_typeoccurrence ← type (shared material, Psets, geometry)
IfcRelAssignsToGroup (system)system.assign_systempipe/duct/cable belongs to a distribution system
2.4 Placement
  • edit_object_placement(f, product=..., matrix=M) takes a 4×4 matrix in **world

coordinates and SI metres (`is_si=True` default); the API stores an `IfcLocalPlacement` relative to the element's placement parent. [verified 0.9.0: window placed with `M[0,3]=2.0, M[2,3]=0.9` reads back `[2. 0. 0.9]` in world space via `ifcopenshell.util.placement.get_local_placement`; after `feature.add_filling` its `PlacementRelTo` is the opening**, relative offset (0,0,0) — fillings are re-parented to their opening. Storey OG stores z = 2.75 directly.]

  • Rotation lives in the upper-left 3×3. For a wall from p1 to p2, x-axis = unit(p2−p1),

y-axis = x rotated +90° — that is exactly what create_2pt_wall builds.

  • Moving a storey later: should_transform_children=True keeps children in place in

world space; the default moves them with the storey. Decide which you want.

2.5 Types, materials, properties, quantities
  • Types first. Create IfcWallType/IfcSlabType/IfcWindowType…, assign the

material set to the type, then type.assign_type each occurrence. Occurrences inherit material and type Psets — one edit to the type updates every instance (system-family thinking, same doctrine as construction-freecad-bim §2.6).

  • Layered walls/slabs: IfcMaterialLayerSet on the type. After

type.assign_type the occurrence gets an IfcMaterialLayerSetUsage automatically [verified 0.9.0: ue.get_material(wall).is_a() → IfcMaterialLayerSetUsage]. The geometric thickness of the wall must equal the sum of layer thicknesses — the API does not enforce this (G-05).

  • Psets: pset.add_pset + pset.edit_pset with a dict. Use the standard

Pset_*Common names and property names exactly (lookup: bim-management §8); project-specific data goes in a custom Pset with a project prefix, never invented Pset_ names (reserved prefix).

  • Quantities: compute them from geometry with ifc5d (§3.5) — it writes the

standard Qto_*BaseQuantities sets. pset.add_qto + pset.edit_qto exist for manual sets; a hand-typed GrossVolume that disagrees with the shape is a silent defect. Custom quantity sets must not use the Qto_ prefix [docs].

2.6 Units — pick metres or millimetres once

unit.assign_unit(f, length={"is_metric": True, "raw": "METERS"}) → project in metres [verified 0.9.0: ifcopenshell.util.unit.calculate_unit_scale(f) → 1.0]. Millimetre projects ("raw": "MILLIMETERS", scale 0.001) are common in DACH exports from Revit/ArchiCAD.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/felixkarevo/construction-skills/ifcopenshell-bim-authoring/badge)](https://verified-skill.com/skills/felixkarevo/construction-skills/ifcopenshell-bim-authoring)

Something wrong with this skill or its page? Tell us.