Skip to content

Commit

Permalink
Minor tune up
Browse files Browse the repository at this point in the history
  • Loading branch information
dalefugier committed Nov 1, 2018
1 parent 32dfded commit 4ff937c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rhinopython/SampleEventHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ def __init__(self):
Rhino.RhinoDoc.ReplaceRhinoObject += self.OnReplaceRhinoObject
Rhino.RhinoDoc.DeleteRhinoObject += self.OnDeleteRhinoObject
Rhino.RhinoDoc.UndeleteRhinoObject += self.OnUndeleteRhinoObject
self.Enabled = True

# Disables the event handlers
def Disable(self):
Rhino.RhinoDoc.AddRhinoObject -= self.OnAddRhinoObject
Rhino.RhinoDoc.ReplaceRhinoObject -= self.OnReplaceRhinoObject
Rhino.RhinoDoc.DeleteRhinoObject -= self.OnDeleteRhinoObject
Rhino.RhinoDoc.UndeleteRhinoObject -= self.OnUndeleteRhinoObject
self.Enabled = False

# Returns the enabled state
def IsEnabled(self):
return self.Enabled

# AddRhinoObject event handler
def OnAddRhinoObject(self, sender, e):
Expand Down

0 comments on commit 4ff937c

Please sign in to comment.