Is there a way to cancel suppression with python extension class?

1081
2
10-10-2016 04:01 AM
FlavieMORAUX1
Occasional Contributor

Is there a way to cancel suppression with python extension class?

I use Python Add-In Wizard (ArcGIS Desktop 10.2.2) to develop extension class. In this extension class I would like to overide behavior when deleting feature.

Here is what I want to do :

def onDeleteFeature(self) :
   res= pythonaddins.MessageBox("Do you want delete to delete these items ?", "Warning",4)
   if res == 'No':
      # Cancel suppression... how to?
      pass
   else:
      # Proceed suppression
      pass
##end def onDeleteFeature

Do you have any idea?

Thanks,

Flavie

0 Kudos
2 Replies
FlavieMORAUX1
Occasional Contributor

I try to raise an exception, but is it without effect. Suppression still occurs.

def onDeleteFeature(self) :
   res= pythonaddins.MessageBox("Do you want delete to delete these items ?", "Warning",4)
   if res == 'No':
      # Cancel suppression... how to?
      raise Exception()
   else:
      # Proceed suppression
      pass
##end def onDeleteFeature

No one has any idea?

0 Kudos
DanPatterson_Retired
MVP Emeritus

well nothing stops.... sys.exit()