GH Python - Insert Named Block Into Named Layouts


Python newbie here, emphasis on the new. I’ve had some success creating some simple scripts running from Rhino via macros.

However, I’m struggling to understand how to apply the same logic from within a Grasshopper python component.

I’ve seen posts and info about referencing active doc, importing syntax, etc. but stuck. I feel like I’m close maybe?


python component in GH that when boolean set true, generates named layouts and inserts a title block onto each sheet.

Ideally it accepts a list of names, a list of different title blocks, and different sheet sizes.

So example sheet names may be “1.0, 2.0, 3.0, 4.0” with title blocks “A1, A2, A2,A5” and sheet sizes may be “Arch D, Arch E1, Arch E1, Arch E”

I’ve got the creation of the layouts part working but failing on the block insertion.
This is in Rhino 8 WIP (not sure if that makes a difference for this or not?)

Thanks for any leads & help!!

Attaching python code to this file: (634 Bytes)

Alright it appears it’s mostly a matter of leveraging script context to reference Rhino.

This portion of another post is what I was looking for.

Leaving in case it helps anyone.

1 Like