Problem in baking via python code

Hi ,

I am new to coding via python , and I am facing a problem that the node failed to bake the geometry , although no errors showing in the IDE window , any advise .

python tutorials _color (6.9 KB)

Note lines 36 and 42 that I added to your code:

You will also need to add the line import Rhino at the top of your code.

See tutorial here for further info:



This was done with Python:

1 Like


thanks your comment has worked .
actually there is something strange , because I followed this code from tutorial , and he is doing it the same code I attached and even baking objects with colors , if you don’t mind can you have look at
Learn Python for Grasshopper - Full Course for Beginners - Free - YouTube at (function and baking part ) .

thanks again for your help

You have created geometry and attributes, but they are not associated with each other.

Change line 41 to:

        sc.doc.Objects.AddBrep(brep, attr)


1 Like

got it , thanks