ifcos-core-runtime

Installation
SKILL.md

IfcOpenShell Python Runtime

Quick Reference

Critical Warnings

  • ALWAYS use == for entity comparison, NEVER is. Each query returns a new Python wrapper object.
  • ALWAYS set entity references to None after calling model.remove(). The C++ object is deallocated regardless of Python reference count.
  • ALWAYS keep a reference to the ifcopenshell.file object alive while any entities from it are in use. If the file is garbage-collected, all entity wrappers become dangling pointers (segfault).
  • NEVER write to an ifcopenshell.file from multiple threads. The C++ backend has no locking. Concurrent writes corrupt the model or crash.
  • NEVER iterate all entities and filter manually when by_type() exists. by_type() uses an internal index and is 10-100x faster.
  • NEVER use get_info(recursive=True) on large models. It materializes the entire entity graph into memory.
  • ALWAYS use named attribute access (wall.Name) instead of positional index access (wall[2]). Positional indices vary by entity type and schema version.
  • ALWAYS check model.schema before accessing schema-specific attributes.

Decision Tree: Entity Reference Safety

Working with entity references?
Related skills

More from openaec-foundation/computational-design-day-delft-march-2026

Installs
1
GitHub Stars
1
First Seen
Mar 24, 2026