Print Monthly chart as Block

Hello fellow coders and designers.

I have been trying to export the Monthly Chart directly from the component using the outputs as inputs for a block definition.

The main idea is to be able to print on a trigger the monthly chart as it is updated based on wallacei running the iterative simulations.

So i need the following items:

  • for the code to be either inserted into the Monthly chart code or a seperate GH python code.

  • a trigger to launch it based on Boolean

  • Lastly a manner to create a block entity that will bake exactly the graph provided into the active document.

Ideally it would be fantastic if I can provide a list of points where the blocks, since there will be many, to be placed in a consecutive manner.

If you have questions concerns ideas please provide them and I will be more than happy to elaborate and or change the approach.

Thanks in advanced.

P.S. i tried using LLM’s and other python ai’s but i feel like they miss some logic that I am trying to develop.

this was my initial attempt but there were many issue.

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

def move_objects(geometry, move_vec):
“”“Moves a list of Rhino objects by a given vector.”“”
moved_geometry =
for obj in geometry:
moved_obj = rs.CopyObject(obj, move_vec)
if moved_obj:
moved_geometry.append(moved_obj)
return moved_geometry

def create_block(geometry, base_pt, block_name=“Ladybug_Chart_Block”):
“”“Creates and bakes a block from the given geometry at the base point.”“”

if not base_pt or not geometry:
    print("Error: Missing base point or geometry.")
    return None

# Ensure layer exists
if not rs.IsLayer(block_name):
    rs.AddLayer(block_name)

# If the block already exists, delete and replace
if rs.IsBlock(block_name):
    rs.DeleteBlock(block_name)

# Create the new block
block_def = rs.AddBlock(geometry, base_pt, block_name, True)

# Insert the block instance at the final location
return rs.InsertBlock(block_name, base_pt)

Grasshopper Inputs:

base_pt = base_pt # Original base point
final_pt = final_point # New location where the block should be placed

Ladybug Monthly Chart outputs:

data_meshes = data_mesh # List of meshes
data_lines = data_lines # List of polylines/curves
col_lines = col_lines if “col_lines” in globals() else # Colored polylines (if exist)
legend = legend # Legend geometry
borders = borders # Axes and grid lines
labels = labels # Month and Y-axis labels
y_title = y_title # Y-axis title
title = title # Global chart title

Combine all elements into a single list

all_geometry = data_meshes + data_lines + col_lines + legend + borders + labels + [y_title, title]

Compute move vector

move_vector = rs.VectorCreate(final_pt, base_pt)

Move objects to new location

moved_geometry = move_objects(all_geometry, move_vector)

Create and bake block

bake_block = create_block(moved_geometry, final_pt, “Ladybug_Chart_Block”)