ifcos-syntax-api

Enforce correct ifcopenshell.api.run() workflows for IFC entity mutations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

IfcOpenShell Python code often breaks or produces invalid IFC when models use the wrong mutation patterns (like creating entities via create_entity() or directly assigning attributes) or when API calls use incorrect parameter conventions. This Skill prevents those production failure modes by enforcing the correct ifcopenshell.api.run() workflow for IFC mutations.

Core Features & Use Cases

  • Stops common IFC-generation mistakes: avoids direct attribute writes and unsafe entity creation patterns, ensuring GlobalIds/ownership/validation are handled via API modules.
  • Enforces correct API invocation and parameter rules: requires importing ifcopenshell.api, passing the file first, using keyword arguments, and using list parameters where required.
  • Guides end-to-end IFC construction flow: promotes the required bootstrap sequence (file → project → units → contexts → spatial hierarchy) and provides decision guidance for which of the 35 API modules to call.
  • Supports safe deletion and schema correctness: recommends root.remove_product over model.remove() for products and clarifies schema/version pitfalls (e.g., project.create_file(version=...)).

Quick Start

Use the ifcos-syntax-api skill to write IfcOpenShell Python that creates and modifies IFC entities using ifcopenshell.api.run() with valid module names, correct parameter names, and safe deletion patterns.

Frequently Asked Questions about ifcos-syntax-api

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

FAQPage Schema
How do I generate valid IfcOpenShell Python code for creating IFC entities?

To generate valid IfcOpenShell Python code for creating IFC entities, you must use the ifcopenshell.api.run() workflow, import ifcopenshell.api, pass the model file first, and use keyword arguments. This prevents invalid schema mutations and ensures proper GlobalId assignment.

Why does my IfcOpenShell Python code break when I assign attributes directly?

IfcOpenShell Python code breaks when assigning attributes directly because it bypasses required validation, ownership, and GlobalId generation. You must use ifcopenshell.api.run() with valid module names instead of direct attribute writes or unsafe entity creation patterns like create_entity().

What is the correct sequence for building a spatial hierarchy in IfcOpenShell?

The correct sequence for building a spatial hierarchy in IfcOpenShell requires bootstrapping in order: create the file, then the project, define units, establish geometry contexts, and finally build the spatial hierarchy. This end-to-end flow ensures valid IFC construction.

How do I safely delete IFC products using IfcOpenShell Python?

To safely delete IFC products using IfcOpenShell Python, you should use the root.remove_product API module rather than calling model.remove() directly. This ensures relationships and dependencies are correctly handled during the deletion process.

What are the parameter conventions for ifcopenshell.api.run() mutations?

The parameter conventions for ifcopenshell.api.run() mutations require passing the model file as the first argument, using keyword arguments for parameters, and providing list parameters for relationship inputs. This ensures correct API invocation and prevents hallucinated module calls.