How to delete all solution states at once?

Hi,

Can someone help me with a script in gh to delete all solution states?

I am missing this option in grasshopper.

See also Can I copy or export a state to another file? . As I am using the solution, mentioned in this topic, I am getting too many states. And I need to hide those states for my students.

Friendly Regards

Bas

I don’t know about that but I would try to copy all the canvas to a new file and overwrite it (just speaking about deleting all states)

This Python code should do it:

import Grasshopper as gh
gh.Instances.ActiveCanvas.Document.StateServer.Clear()