/blender-bim-sverchok:bonsai-errors-commonfrom Blender por código, BIM (Bonsai e IfcOpenShell) y Sverchok
Use when debugging Bonsai errors -- IFC schema violations, spatial hierarchy errors, property set failures, geometry representation issues, or operator poll failures. Prevents wasting time on symptoms instead of root causes (e.g., missing IfcOwnerHistory in IFC2X3 causing cryptic errors). Provides diagnostic decision trees and recovery strategies for all common Bonsai failure modes. Keywords: Bonsai error, schema violation, spatial hierarchy error, poll failure, drawing error, BCF error, IFC error, troubleshooting, debug, Bonsai not working, Bonsai crashes, element not showing.
Ships in Blender por código, BIM (Bonsai e IfcOpenShell) y Sverchok. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Version: Bonsai v0.8.x | Blender 4.2.0+ | Python 3.11 Module path:
bonsai.*— NEVERblenderbim.*Dependencies: bonsai-core-architecture, bonsai-syntax-elements
Bonsai error encountered?
│
├── Python ImportError / ModuleNotFoundError?
│ ├── "No module named 'blenderbim'" → §1.1 (rename migration)
│ ├── "No module named 'bpy'" → §1.2 (wrong Python environment)
│ └── "No module named 'bonsai'" → §1.3 (addon not installed)
│
├── AttributeError / RuntimeError on IFC operation?
│ ├── "NoneType has no attribute 'by_type'" → §2.1 (no IFC file loaded)
│ ├── "No entity with id X" → §2.2 (stale entity reference)
│ ├── "RuntimeError: No structural analysis view context" → §2.3 (missing context)
│ └── "'void' module" or "add_opening" → §2.4 (deprecated API)
│
├── IFC schema violation or validation failure?
│ ├── Missing IfcProject / IfcUnitAssignment → §3.1 (invalid project)
│ ├── Wrong spatial hierarchy (aggregate vs contain) → §3.2
│ ├── Missing representation context → §3.3
│ └── Singular vs list parameter error → §3.4 (v0.8+ API change)
│
├── Geometry / placement issue?
│ ├── Object moved but IFC placement unchanged → §4.1
│ ├── Geometry not visible after creation → §4.2
│ └── Geometry corruption after external edit → §4.3
│
├── Property set error?
│ ├── Properties not written to IFC → §5.1
│ ├── Pset values not appearing in UI → §5.2
│ └── Weight calculation returns None → §5.3
│
├── Operator poll failure (greyed out / RuntimeError)?
│ ├── No active IFC file → §6.1
│ ├── No active object / wrong selection → §6.2
│ ├── Wrong Blender mode (Edit vs Object) → §6.3
│ └── No active camera / drawing context → §6.4
│
├── Drawing generation error?
│ ├── Empty SVG output → §7.1
│ ├── Missing annotations → §7.2
│ ├── Sheet composition failure → §7.3
│ └── InkScape dependency error → §7.4
│
├── BCF workflow error?
│ ├── BcfStore initialization failure → §8.1
│ ├── Viewpoint coordinate mismatch → §8.2
│ └── Version conflict (v2 vs v3) → §8.3
│
└── Clash detection error?
├── Empty results on known conflicts → §9.1
├── Unsaved IFC file → §9.2
└── Missing Group A/B definition → §9.3
Error: ModuleNotFoundError: No module named 'blenderbim'
Cause: Using pre-2024 import paths. Bonsai was renamed from BlenderBIM in v0.8.0 (September 2024).
Fix: Replace ALL blenderbim.* imports with bonsai.*:
| Old (WRONG) | New (CORRECT) |
|---|---|
from blenderbim.bim.ifc import IfcStore | from bonsai.bim.ifc import IfcStore |
import blenderbim.tool as tool | import bonsai.tool as tool |
import blenderbim.core.spatial | import bonsai.core.spatial |
Rule: ALWAYS use bonsai.*. Operator bl_idname values (bim.*) did NOT change.
Error: ModuleNotFoundError: No module named 'bpy'
Cause: Running Bonsai scripts from system Python instead of Blender's bundled Python.
Fix: ALWAYS execute via Blender:
blender --background --python my_script.py
NEVER run python3 my_script.py for scripts importing bonsai.* or bpy.
Error: ModuleNotFoundError: No module named 'bonsai'
Diagnosis:
ldd --version | head -1)Error: AttributeError or ImportError after upgrading Bonsai
Cause: Stale .pyc bytecode from previous version.
Fix:
find ~/.config/blender/4.2/scripts/addons/bonsai/ -name "__pycache__" -type d -exec rm -rf {} +
Then restart Blender completely.
Error: AttributeError: 'NoneType' object has no attribute 'by_type'
Cause: IfcStore.get_file() returns None — no IFC project is loaded.
Fix: ALWAYS guard IFC access:
model = IfcStore.get_file()
if model is None:
raise RuntimeError("No IFC project loaded. Open an IFC file first.")
Error: RuntimeError: No entity with id X or entity attributes return unexpected values.
Cause: Entity references become invalid after file reload, undo operations, or external file modification.
Fix: NEVER cache entity references across operations. ALWAYS re-query:
entity = model.by_id(step_id) # Re-query each time
Error: RuntimeError: No structural analysis view context found or geometry creation fails silently.
Cause: Adding geometry or representations without required IfcGeometricRepresentationContext.
Fix: ALWAYS verify context exists before creating geometry:
import ifcopenshell.util.representation
body_context = ifcopenshell.util.representation.get_context(
model, "Model", "Body", "MODEL_VIEW")
if not body_context:
model_ctx = ifcopenshell.api.run("context.add_context", model,
context_type="Model")
body_context = ifcopenshell.api.run("context.add_context", model,
context_type="Model", context_identifier="Body",
target_view="MODEL_VIEW", parent=model_ctx)
Error: Module void not found or add_opening does not exist.
Cause: void.add_opening() was replaced by feature.add_feature() in IfcOpenShell v0.8.0+.
Fix:
# WRONG
ifcopenshell.api.run("void.add_opening", model, opening=opening, element=wall)
# CORRECT
ifcopenshell.api.run("feature.add_feature", model, feature=opening, element=wall)
Error: IFC validation failure — missing IfcProject or IfcUnitAssignment.
Cause: Creating IFC files with ifcopenshell.file() directly instead of the project API.
Fix: ALWAYS use the project creation API:
model = ifcopenshell.api.project.create_file(version="IFC4")
ifcopenshell.api.unit.assign_unit(model)
NEVER use ifcopenshell.file() directly — it skips IfcProject, unit assignment, and context creation.
Error: Elements appear in wrong hierarchy level or validation reports spatial errors.
Cause: Confusing IfcRelAggregates (spatial decomposition) with IfcRelContainedInSpatialStructure (element containment).
Decision tree:
Placing an element?
├── Physical element (wall, column, slab) into a storey?
│ └── spatial.assign_container (creates IfcRelContainedInSpatialStructure)
│
├── Spatial element (storey) into building?
│ └── aggregate.assign_object (creates IfcRelAggregates)
│
└── Building into site?
└── aggregate.assign_object (creates IfcRelAggregates)
Rule: ALWAYS use spatial.assign_container for physical elements. ALWAYS use aggregate.assign_object for spatial hierarchy.
See §2.3. Every IFC project MUST have at least a Model/Body/MODEL_VIEW context before assigning geometry.
Error: KeyError or TypeError when calling relationship API functions.
Cause: IfcOpenShell v0.8+ changed singular parameters to lists.
Fix:
# WRONG (pre-v0.8 style)
ifcopenshell.api.run("spatial.assign_container", model,
product=wall, relating_structure=storey)
# CORRECT (v0.8+ style)
ifcopenshell.api.run("spatial.assign_container", model,
products=[wall], relating_structure=storey)
# WRONG
ifcopenshell.api.run("type.assign_type", model,
related_object=wall, relating_type=wall_type)
# CORRECT
ifcopenshell.api.run("type.assign_type", model,
related_objects=[wall], relating_type=wall_type)
Rule: ALWAYS pass lists to products, related_objects parameters, even for single entities.
Error: Object appears moved in Blender viewport but IFC IfcLocalPlacement retains old coordinates.
Cause: Blender transform operations (G key, obj.location = ...) do NOT auto-update IFC placement.
Fix: ALWAYS call after any transform change:
bpy.ops.bim.edit_object_placement()
Diagnostic checklist:
geometry.assign_representation was calledtool.Ifc.link(entity, obj)Error: IFC data inconsistent with Blender viewport after editing .ifc file externally.
Cause: Editing the IFC file on disk while Blender has the project open.
Fix: NEVER edit .ifc files externally while Blender has them open. After external modification: File > Reload IFC Project.
Error: Property values set in Blender UI or via obj.PsetProperties do not persist in IFC file.
Cause: Modifying Blender UI properties does NOT automatically write to IFC.
Fix: ALWAYS use ifcopenshell.api:
pset = ifcopenshell.api.run("pset.add_pset", model,
product=wall, name="Pset_WallCommon")
ifcopenshell.api.run("pset.edit_pset", model,
pset=pset, properties={"FireRating": "REI60"})
Cause: Bonsai data cache not refreshed after direct API modifications.
Fix: Purge the relevant data cache:
from bonsai.bim.module.pset.data import PsetData
PsetData.purge()
Error: get_net_weight() or get_gross_weight() returns None or zero.
Cause: Pset_MaterialCommon.MassDensity not assigned to the element's material.
Fix: ALWAYS assign material density BEFORE running weight calculations.
Bonsai operators implement poll() classmethods that check prerequisites. When poll() returns False, operators are greyed out in UI and raise RuntimeError from Python.
Symptom: Most bpy.ops.bim.* operators fail or are greyed out.
Fix: Load or create an IFC project first:
bpy.ops.bim.create_project(template="metric_m")
# OR
bpy.ops.bim.load_project(filepath="project.ifc")
Symptom: Element-specific operators (edit placement, assign class) fail.
Fix: ALWAYS verify selection:
obj = bpy.context.active_object
if obj is None:
raise RuntimeError("No active object selected")
if obj.BIMObjectProperties.ifc_definition_id == 0:
raise RuntimeError("Active object has no IFC assignment")
Symptom: Operators that require Object mode fail in Edit mode (or vice versa).
Fix: Switch mode before calling:
if bpy.context.mode != 'OBJECT':
bpy.ops.object.mode_set(mode='OBJECT')
Symptom: Drawing operators (bim.create_drawing, bim.add_annotation) fail.
Fix: ALWAYS activate a drawing camera before calling drawing operators:
if bpy.context.scene.camera is None:
raise RuntimeError("No active camera. Activate a drawing view first.")
Diagnostic checklist:
sync=True in bim.create_drawing)has_linework and/or has_underlay MUST be enabledCause: Annotations are ONLY generated for orthographic camera views.
Fix: NEVER use perspective cameras for annotated drawings. Verify camera type is ORTHO.
Cause: InkScape not installed or not on system PATH.
Fix: Install InkScape. Sheet composition and PDF/DXF export REQUIRE InkScape.
Error: FREESTYLE linework mode produces no output.
Fix: Enable the Freestyle SVG Exporter add-on in Blender preferences before using FREESTYLE mode.
Cause: Accessing BcfStore.bcfxml directly instead of using the lazy initializer.
Fix: ALWAYS use BcfStore.get_bcfxml() for proper initialization and path resolution.
Cause: Viewpoint activation applies georeference offsets. Coordinate systems may differ between BCF source and loaded model.
Fix: Verify georeference settings match between the model that created the BCF and the model loading it.
Error: Operations fail when mixing BCF v2.1 and v3.0 data.
Fix: NEVER mix BCF versions within a single file. The version is detected on load and MUST remain consistent.
Rule: ALWAYS configure BCFProperties.author before creating topics or comments. ALWAYS call bim.save_bcf_project to persist changes.
Diagnostic checklist:
clash_set.mode matches the conflict type (intersection vs clearance)Error: Clash detection runs but finds no clashes in recently modified geometry.
Cause: Clash detection operates on IFC files on disk, NOT the live Blender scene.
Fix: ALWAYS save the IFC file before running clash detection:
bpy.ops.bim.save_project()
bpy.ops.bim.execute_ifc_clash()
Error: Clash detection requires both Group A and Group B.
Fix: ALWAYS define both groups, even for intra-model clashes (e.g., structural vs MEP from the same file).
Cause: Direct ifcopenshell.api calls do NOT trigger Blender viewport refresh.
Fix: After direct API modifications:
# For property changes: purge data cache
from bonsai.bim.module.pset.data import PsetData
PsetData.purge()
# For geometry changes: trigger representation update
bpy.ops.bim.update_representation(obj=obj.name)
Cause: IfcStore is NOT thread-safe. Bonsai operators require the main thread.
Fix: NEVER use threading with Bonsai operations. For deferred execution, use:
bpy.app.timers.register(my_deferred_function)
Cause: Undo invalidates IfcStore.file and all cached entity references.
Fix: NEVER store entity references across undo operations. ALWAYS re-query after undo.
What SKILL.md sets; muted values are Claude Code's defaults
73 skills in this plugin
/aec-agents-workflow-orchestratorUse when a task spans multiple AEC technologies (Blender, IfcOpenShell, Bonsai, Sverchok) and you need to decide which tool handles which step, or when orchestrating multi-step BIM pipelines such as IFC creation to visualization to authoring. Prevents the common mistake of mixing IfcStore.get_file() with ifcopenshell.open() in the same context, or calling Bonsai operators outside a Bonsai-loaded session. Provides decision trees for technology selection, workflow sequencing, and bridge patterns between tools. Keywords: cross-technology, workflow orchestration, BIM pipeline, technology selection, Blender IfcOpenShell Bonsai integration, multi-step AEC, bridge pattern, which tool should I use, combine Blender and IFC, multi-tool workflow, how to connect tools.
/aec-core-bim-workflowsUse when implementing end-to-end BIM workflows that combine IfcOpenShell, Bonsai, and Blender -- such as IFC creation from scratch, model enrichment, validation pipelines, geometry extraction, or batch processing of building models. Prevents the common mistake of skipping unit and context setup before creating geometry, or directly modifying IFC attributes instead of using ifcopenshell.api.run(). Covers property set management across tools, spatial hierarchy patterns, and version compatibility for IFC2X3/IFC4/IFC4X3. Keywords: BIM workflow, IFC creation, model validation, property extraction, batch processing, spatial hierarchy, cross-technology, IfcOpenShell Bonsai Blender, pset management, how to create IFC model, step by step BIM, get properties from IFC.
/blender-agents-code-validatorUse when reviewing, validating, or auditing Blender Python code for correctness. Runs systematic checks for deprecated API usage, context errors, version compatibility issues, threading violations, data reference invalidation, incorrect operator calls, and addon structure compliance. Prevents shipping code with silent version-dependent failures. Keywords: code review, validation, audit, deprecated API, context error, version compatibility, threading, addon structure, code quality, Blender Python, my addon has errors, check my code, why does my script fail.
/blender-agents-version-migratorUse when migrating, porting, or upgrading Blender Python scripts and addons across major versions (3.x to 4.x to 5.x). Provides a systematic migration process covering API renames, removed functions, changed parameters, extension system migration, BGL to GPU module conversion, and bone collection migration. Prevents incomplete migrations that compile but fail at runtime. Keywords: migration, porting, upgrade, version, 3.x to 4.x, 4.x to 5.x, API rename, bgl to gpu, extension migration, bl_info to manifest, bone collection, script stopped working after update, upgrade addon to new Blender.
/blender-core-apiUse when writing Blender Python scripts that access bpy module structure, RNA data, the context system, dependency graph, or operator invocation. Prevents the common mistake of accessing context attributes outside their valid scope or calling operators without checking poll(). Covers bpy.data, bpy.context, bpy.ops, depsgraph evaluation, and RNA property access patterns across Blender 3.x/4.x/5.x. Keywords: bpy, Blender Python, RNA, context, depsgraph, operator, bpy.data, bpy.ops, how to start scripting Blender, Blender Python basics, access objects in scene, get selected object.
/blender-core-gpuUse when drawing custom overlays, viewport visualizations, or offscreen renders in Blender Python. Prevents the critical mistake of using the deprecated bgl module (removed in Blender 5.0) instead of the gpu module. Covers gpu.shader, gpu.batch, gpu.state, SpaceView3D draw handlers, built-in shaders, and BGL-to-gpu migration. Keywords: gpu module, bgl, draw handler, viewport overlay, offscreen rendering, SpaceView3D, shader, UNIFORM_COLOR, Blender Python drawing, draw on viewport, custom overlay, draw lines in 3D view.
Other plugins' skills for the same job
npx claudepluginhub lagzgabrielmuller-dot/kit-ingenieria-3d --plugin blender-bim-sverchok