diff --git a/rhinopython/SampleEventHandler.py b/rhinopython/SampleEventHandler.py index b3a50eb6..a8522ece 100644 --- a/rhinopython/SampleEventHandler.py +++ b/rhinopython/SampleEventHandler.py @@ -18,6 +18,7 @@ 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): @@ -25,6 +26,11 @@ def Disable(self): 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):