Trying to do culling in ghpython

Hey everyone!

I’m quite new to python and totally new to doing it in ghpython so right now I’m trying to replicate parts of my grasshopper script, but with ghpython instead.

I have uploaded the script with the part I’m working on grouped. Also uploaded a picture of where it goes wrong. I specifically don’t understand why I get the error, but I hope some of you can easily spot what I’m trying to do and why it is not working. Otherwise just let me know and I’ll try to elaborate on what I want it to do :slight_smile:

Have a good one and thanks for taking the time. (42.5 KB)

You need a colon : at the end of the if statement in line 12 and the elif statement in line 14.

1 Like

You don’t need rhinoscriptsyntax, scriptcontext or operator for the stuff you want to do. So you can delete the first three lines.

For a python beginner, it’s very useful to go through line by line and use the print function to print variables. Try to learn what each line does, and you will pick up very quickly.

If you got the codes from somewhere else, it is still very helpful to rewrite them yourself so you understand it more.

1 Like