ifcos-core-runtime

Correct IfcOpenShell entity lifecycle, identity, and performance patterns in Python code.

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-core-runtime-impertio-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ifcos-core-runtime
Source: https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package/tree/main/skills/ifcopenshell/core/ifcos-core-runtime
Command: npx skills add https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package --skill ifcos-core-runtime-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents hard-to-diagnose IfcOpenShell runtime failures by correcting common entity-lifecycle, identity, and performance mistakes that lead to crashes, segfaults, or invalid IFC outputs.

Core Features & Use Cases

  • Entity safety & lifecycle guardrails: Avoids dangling entity wrapper references after removals and ensures the parent ifcopenshell.file stays alive.
  • Correct identity and comparison practices: Uses == and .id() rather than is to prevent logic errors when working with Python wrappers over C++ objects.
  • Performance-safe query and inspection patterns: Recommends by_type() indexing, avoids expensive get_info(recursive=True), and uses PascalCase attribute access to reduce schema/version issues.
  • Thread-safety and memory management: Enforces single-thread write rules and safe parallelization via separate file instances for each thread.

Quick Start

Ask Claude to help you rewrite your IfcOpenShell Python code to avoid segfaults by nullifying entity references after removal, using == or .id() for comparisons, and switching to by_type() and non-recursive get_info() for large models.

Frequently Asked Questions about ifcos-core-runtime

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

FAQPage Schema
Why does IfcOpenShell crash or segfault after calling remove() on an entity?

IfcOpenShell runtime crashes after remove() occur because Python wrappers still hold dangling references to deleted C++ objects. Nullifying entity references immediately after deallocation and keeping the parent ifcopenshell.file alive prevents these segfaults.

How do I correctly compare IfcOpenShell entity wrappers in Python?

Compare IfcOpenShell entity wrappers using equality operators like == or .id() rather than Python's identity operator is. Using is on Python wrappers over C++ objects causes logic errors because distinct wrapper instances can represent the same underlying entity.

What is the best way to query large IFC models without performance issues in IfcOpenShell?

Query large IFC models safely by indexing with by_type() and avoiding expensive get_info(recursive=True) calls. Using schema-aware PascalCase attribute access further reduces schema version issues and prevents unnecessary graph materialization.

Can I use IfcOpenShell for multi-threaded IFC file processing?

IfcOpenShell supports thread-safe parallelization only by using separate file instances for each thread. Enforcing single-thread write rules is required because concurrent read and write operations on the same ifcopenshell.file instance will cause invalid IFC behavior.

How do I fix invalid IFC behavior caused by incorrect entity lifecycle management?

Fix invalid IFC behavior by ensuring the parent ifcopenshell.file stays alive, nullifying entity references after removal, and following schema-aware PascalCase attribute access to maintain correct entity identity throughout the lifecycle.