GH Python _Purge (Layers=Yes)

Hi guys

Good day.
I am new to GH Python and I was trying to understand the code from this old thread.

My objective here is to create a button that execute a global _Purge command (All Layers) in Grasshopper. Is this possible?

Thanks and Best Regards
Chua Ching Hong

You can get all layers with the following line of code and then a for loop to delete or purge.

layers = rs.LayerNames()

Thanks Martin! Let me try it out.

1 Like