/blender-bim-sverchok:bonsai-impl-drawingfrom Blender por código, BIM (Bonsai e IfcOpenShell) y Sverchok
Use when generating 2D drawings from IFC models in Bonsai -- plans, sections, elevations, annotations, or sheet layouts. Prevents the common mistake of creating views without proper drawing style configuration (getting empty or unfiltered output). Covers the complete documentation pipeline from model views through annotations to printable SVG sheet output. Keywords: drawing, plan, section, elevation, annotation, sheet, SVG, titleblock, documentation, 2D drawing, Bonsai drawing, create floor plan, generate section view, print drawings.
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+ | Python 3.11 Module path:
bonsai.bim.module.drawing— NEVERblenderbim.bim.module.drawingDependencies: bonsai-core-architecture (Bonsai tool/core/operator pattern)
bonsai.bim.module.drawing — NEVER use blenderbim.bim.module.drawing (legacy name)bim.create_drawingsync=True or save first)The drawing module follows Bonsai's core/tool/operator pattern:
bonsai/core/drawing.py → Pure logic (no Blender imports)
bonsai/tool/drawing.py → Blender-specific implementation
bonsai/bim/module/drawing/
├── operator.py → 40+ Blender operators
├── prop.py → Property definitions
├── ui.py → Panel UI
├── annotation.py → Annotator class (geometry creation)
├── svgwriter.py → SvgWriter class (SVG engine)
├── sheeter.py → SheetBuilder class (sheet composition)
├── decoration.py → Viewport decorations
├── gizmos.py → Interactive annotation gizmos
├── handler.py → Event handlers
├── helper.py → Utilities (format_distance, BoundingBox)
├── scheduler.py → Schedule/table generation
├── shaders.py → GPU shaders for viewport
├── workspace.py → AnnotationTool workspace + keymaps
└── data.py → Data loading and caching
What type of drawing do you need?
│
├─ Floor plan (top-down view) → target_view="PLAN_VIEW"
├─ Vertical section (cut through) → target_view="SECTION_VIEW"
├─ Facade/external view → target_view="ELEVATION_VIEW"
├─ Reflected ceiling plan → target_view="REFLECTED_PLAN_VIEW"
└─ 3D perspective/axonometric → target_view="MODEL_VIEW"
Each drawing is backed by:
IfcAnnotation entity in an IfcGroupEPset_Drawing property set:
TargetView — one of the five view typesScale — diagram scale (e.g., "1:100")HumanScale — display string for scaleHasUnderlay — render-based background image toggleHasLinework — vector line drawing toggleHasAnnotation — annotation overlay toggle# Bonsai v0.8.x: Add a plan view drawing
import bpy
bpy.ops.bim.add_drawing(
target_view="PLAN_VIEW",
location_hint=0 # 0 = auto-detect from active storey
)
Location hint rules:
PLAN_VIEW / REFLECTED_PLAN_VIEW: location_hint maps to building storey indexSECTION_VIEW / ELEVATION_VIEW: location_hint represents direction (N/S/E/W)MODEL_VIEW: location_hint is ignoredCore function (bonsai/core/drawing.py):
# Bonsai v0.8.x: add_drawing creates:
# 1. Unique drawing name from target_view
# 2. Camera matrix from target_view + location_hint
# 3. IfcAnnotation via ifcopenshell.api.run("root.create_entity")
# 4. IfcGroup for annotations
# 5. IfcDocumentReference to SVG output path
# 6. EPset_Drawing properties (TargetView, Scale, etc.)
# 7. Blender camera object assigned to collection
# Bonsai v0.8.x: Camera/drawing configuration
# Access via camera object's BIMCameraProperties
# Scale options (metric):
# 1:5000, 1:2000, 1:1000, 1:500, 1:200, 1:100, 1:50,
# 1:20, 1:10, 1:5, 1:2, 1:1, CUSTOM
# Custom scale: custom_scale_numerator / custom_scale_denominator
# Camera type: ORTHO (orthographic) | PERSP (perspective)
# Raster resolution: raster_x, raster_y (default 1000 px each)
# DPI: default 75
# View dimensions: width, height (default 50 m each)
# NTS flag: is_nts (Not To Scale)
Layer toggles (control what the drawing contains):
has_underlay — render-based background imagehas_linework — vector line drawinghas_annotation — annotation overlaysFilter mode: NONE or include/exclude filter groups for element visibility control.
# Bonsai v0.8.x: Add annotations to the active drawing
import bpy
# PREREQUISITE: MUST have active drawing (camera view)
# Add a text annotation
bpy.ops.bim.add_annotation(object_type="TEXT")
# Add a dimension with type reference
bpy.ops.bim.add_annotation(
object_type="DIMENSION",
relating_type_id=42 # IFC ID of annotation type
)
Supported annotation types:
| Type | Description | Blender Data |
|---|---|---|
TEXT | Text labels | Mesh |
TEXT_LEADER | Text with leader line | Curve |
DIMENSION | Linear dimensions | Mesh |
ANGLE | Angular dimensions | Mesh |
SECTION_LEVEL | Section cut markers | Mesh |
PLAN_LEVEL | Level indicators | Mesh |
ELEVATION | Elevation markers (SVG symbols) | Mesh |
GRID | Grid line references | Mesh |
FILL_AREA | Hatching and fills | Mesh |
STAIR_ARROW | Stair direction indicators | Mesh |
HIDDEN_LINE | Hidden/dashed lines | Mesh |
BREAKLINE | Break line symbols | Mesh |
Text properties (BIMTextProperties):
# Bonsai v0.8.x: Generate SVG from active drawing
bpy.ops.bim.create_drawing(
sync=True, # Pre-sync IFC data (ALWAYS recommended)
print_all=False, # False = active drawing only; True = all checked drawings
open_viewer=False # Launch viewer after generation
)
SVG generation pipeline:
CreateDrawing Pipeline (bim.create_drawing):
1. Initialize camera and drawing metadata
2. Sync IFC file (if sync=True)
3. Generate UNDERLAY (raster render → PNG → embedded in SVG)
4. Generate LINEWORK (vector):
├─ OPENCASCADE mode → HLR via OCC library (precise, slower)
└─ FREESTYLE mode → Blender Freestyle SVG Exporter (artistic, faster)
5. Generate ANNOTATIONS (via SvgWriter, orthographic only)
6. Combine all SVG layers into final output
Linework mode decision:
| Situation | Use |
|---|---|
| Precise hidden-line removal needed | OPENCASCADE mode |
| Artistic line styles preferred | FREESTYLE mode |
| FREESTYLE mode selected | ALWAYS verify Freestyle SVG Exporter add-on is enabled |
Fill modes (fill_mode): NONE, SHAPELY (polygon fills), SVGFILL (SVG-native patterns)
Cut modes (cut_mode): BISECT (Blender mesh bisect), OPENCASCADE (OCC section cutting)
# Bonsai v0.8.x: Sheet composition pipeline
# Step 1: Create sheet with titleblock
bpy.ops.bim.add_sheet()
# Creates IfcDocumentInformation + IfcDocumentReference
# Generates base SVG layout from titleblock template
# Step 2: Add drawings to sheet
bpy.ops.bim.add_drawing_to_sheet()
# Links drawing (IfcDocumentReference) to the sheet
# Step 3: Build final sheet
bpy.ops.bim.create_sheets()
# Composes all drawings into sheet SVG
# Optionally exports to PDF/DXF (requires InkScape)
SheetBuilder (sheeter.py) composition process:
ensure_drawing_unique_styles() (prefixes CSS classes), applies clipping pathsAuto-layout (next_drawing_location()):
# Bonsai v0.8.x: Open generated outputs
bpy.ops.bim.open_drawing() # Open SVG with system viewer
bpy.ops.bim.open_sheet() # Open sheet with system viewer
bpy.ops.bim.open_layout() # Open SVG layout file
The SvgWriter converts 3D model coordinates to SVG canvas:
3D world coordinates
→ project_point_onto_camera() (plane intersection)
→ camera-space coordinates
→ offset to canvas center, scale by (diagram_scale × 1000)
→ SVG canvas coordinates (millimeters)
Unit conversion: IFC meters → SVG millimeters.
convert_to_mm() normalizes CSS length units (cm, in, pt, px, Q, pc) to millimeters for positioning.
| Operator | bl_idname | Purpose |
|---|---|---|
| AddDrawing | bim.add_drawing | Create new drawing view with camera |
| CreateDrawing | bim.create_drawing | Generate/refresh SVG |
| DuplicateDrawing | bim.duplicate_drawing | Copy drawing (optional annotation copy) |
| AddAnnotation | bim.add_annotation | Add annotation to active drawing |
| AddAnnotationType | bim.add_annotation_type | Create annotation type template |
| AddSheet | bim.add_sheet | Create new sheet document |
| CreateSheets | bim.create_sheets | Build sheets with PDF/DXF export |
| AddDrawingToSheet | bim.add_drawing_to_sheet | Link drawing to sheet |
| OpenSheet | bim.open_sheet | Open sheet with viewer |
| OpenDrawing | bim.open_drawing | Open SVG with viewer |
| OpenLayout | bim.open_layout | Open SVG layout file |
| ActivateModel | bim.activate_model | Switch to 3D model view |
| SelectAllDrawings | bim.select_all_drawings | Batch select drawings |
| SelectAllSheets | bim.select_all_sheets | Batch select sheets |
The AnnotationTool workspace provides dedicated annotation editing:
| Shortcut | Action |
|---|---|
Shift+A | Add new annotation |
Shift+T | Bulk tag (auto-adjust to selected objects) |
Shift+G | Readjust tags based on assigned products |
Shift+E | Edit text annotations |
DrawingStyle PropertyGroup controls rendering appearance:
render_type: DEFAULT (Blender render settings) or VIEWPORT (viewport shading)raster_style: JSON-formatted render configuration stringWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lagzgabrielmuller-dot/kit-ingenieria-3d --plugin blender-bim-sverchok73 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.
Other plugins' skills for the same job