ifcos-core-runtime
Installation
SKILL.md
IfcOpenShell Python Runtime
Quick Reference
Critical Warnings
- ALWAYS use
==for entity comparison, NEVERis. Each query returns a new Python wrapper object. - ALWAYS set entity references to
Noneafter callingmodel.remove(). The C++ object is deallocated regardless of Python reference count. - ALWAYS keep a reference to the
ifcopenshell.fileobject 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.filefrom 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.schemabefore accessing schema-specific attributes.