ifcos-impl-relationships

Create IFC relationship entities with ifcopenshell.api.run() across IFC2X3 and IFC4.

30|4|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package --skill ifcos-impl-relationships-impertio-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ifcos-impl-relationships
Source: https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package/tree/main/skills/ifcopenshell/impl/ifcos-impl-relationships
Command: npx skills add https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package --skill ifcos-impl-relationships-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Prevents orphaned IFC elements and incorrect BIM semantics by guiding deterministic creation and management of objectified IFC relationship entities (containment, aggregation, type assignment, property/material association, and voids) across IFC2X3 vs IFC4 differences.

Core Features & Use Cases

  • Spatial containment and references: Assigns elements to a single primary spatial container and supports IFC4+ secondary references for elements spanning multiple storeys.
  • Decomposition and nesting: Creates correct whole/part relationships via aggregation and host/component attachment via nesting, avoiding category-mistakes that break downstream BIM tools.
  • Type, property, and material linking: Assigns IfcRelDefinesByType, manages property sets (IfcRelDefinesByProperties), and associates materials (IfcRelAssociatesMaterial) using safe API patterns.
  • Voids and fillings: Cuts openings with IfcRelVoidsElement and fills them with IfcRelFillsElement for consistent window/door workflows.
  • Robust guardrails: Enforces API usage patterns (use ifcopenshell.api.run()), version-safe querying (ifcopenshell.util.element), and relationship cleanup on reassignment/removal.

Quick Start

Use this skill to generate IfcOpenShell code that assigns a wall to the correct storey container, applies a wall type, adds a property set with values, and creates a window opening with a filled window—without leaving the wall orphaned.

Frequently Asked Questions about ifcos-impl-relationships

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I assign a wall to a spatial container using IfcOpenShell without orphaning the element?

Use ifcopenshell.api.run() to create spatial containment relationships, ensuring the element is assigned to a single primary spatial container and cleaning up any previous assignments to prevent orphaned IFC entities.

What's the difference between IFC2X3 and IFC4 when managing spatial references and inverse attributes?

IFC4 and IFC4X3 support secondary spatial references for elements spanning multiple storeys, whereas IFC2X3 does not; inverse attributes and relationship availability differ across these schema versions, requiring version-safe query utilities.

How do I create window openings and fill them in an IFC model with IfcOpenShell?

Use ifcopenshell.api.run() to cut openings with IfcRelVoidsElement and fill them with IfcRelFillsElement, establishing consistent void and filling relationships for window and door workflows.

How do I assign IfcRelDefinesByType and property sets safely in IfcOpenShell?

Use ifcopenshell.api.run() to assign IfcRelDefinesByType, manage property sets via IfcRelDefinesByProperties, and associate materials using IfcRelAssociatesMaterial while enforcing safe API patterns to avoid schema-invalid inverse traversal.

Does ifcopenshell.util.element handle relationship cleanup when reassigning elements to new containers?

Yes, using version-safe query utilities from ifcopenshell.util.element alongside ifcopenshell.api.run() enforces relationship cleanup during reassignment and removal, preventing orphan entities and maintaining correct BIM semantics.

Why do my IFC elements become orphaned after reassigning spatial containment in IfcOpenShell?

Orphaned IFC elements occur when relationship entities are not properly cleaned up during reassignment; using ifcopenshell.api.run() and version-safe query utilities enforces correct cleanup and prevents schema-invalid inverse traversal.