Skip to content

Instantly share code, notes, and snippets.

@tmshv
Last active December 8, 2015 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmshv/5128f7141a6db0704709 to your computer and use it in GitHub Desktop.
Save tmshv/5128f7141a6db0704709 to your computer and use it in GitHub Desktop.
Grasshopper Last State
# x is input value with list type
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
sc.doc = Rhino.RhinoDoc.ActiveDoc
lastValue = rs.GetDocumentData('hello', 'lastState')
currentValue = ','.join(map(str, x))
rs.SetDocumentData('hello', 'lastState', currentValue)
if lastValue != currentValue:
a = 1
else:
a = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment