import pythonaddins def onMouseDownMap(self, x, y, button, shift): msg = "You just clicked in the map display" pythonaddins.MessageBox(msg, 'Report Click Event', 0)
Thanks. I understand the concept and am glad there will be improved status reporting. However I still can't get either method to work. Here is the code:class PostReconcile(object): """Implementation for street_centerlines_addin.btn1 (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): arcpy.ReconcileVersions_management(db,"ALL_VERSIONS","SDE.Default","CD_LYN.lyn","LOCK_ACQUIRED","NO_ABORT","BY_OBJECT","FAVOR_TARGET_VERSION","POST","KEEP_VERSION") arcpy.CopyFeatures_management(fc,shp1) arcpy.CopyFeatures_management(fc,shp2) arcpy.CopyFeatures_management(fc,shp3) arcpy.CopyFeatures_management(fc,shp4) arcpy.CopyFeatures_management(fc,shp5) pythonaddins.MessageBox('Copied files to local drive', 'INFO', 0)When I press the button, it just runs with no message popup. I also tried a print statement, but nothing shows in the Python window. Must have it in the wrong spot...
class PostReconcile(object): """Implementation for street_centerlines_addin.btn1 (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): arcpy.ReconcileVersions_management(db,"ALL_VERSIONS","SDE.Default","CD_LYN.lyn","LOCK_ACQUIRED","NO_ABORT","BY_OBJECT","FAVOR_TARGET_VERSION","POST","KEEP_VERSION") arcpy.CopyFeatures_management(fc,shp1) arcpy.CopyFeatures_management(fc,shp2) arcpy.CopyFeatures_management(fc,shp3) arcpy.CopyFeatures_management(fc,shp4) arcpy.CopyFeatures_management(fc,shp5) pythonaddins.MessageBox('Copied files to local drive', 'INFO', 0)
class PostReconcile(object): """Implementation for street_centerlines_addin.btn1 (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): pythonaddins.MessageBox('Copied files to local drive', 'INFO', 0)
...In 10.3 we've thought about this and we're adding a progress dialog into the pythonaddins module.
with pythonaddins.ProgressDialog as dialog: dialog.title = "Doing work..." dialog.label = "Opening cursor..." # Do some work here dialog.label = "Working..." # More work here dialog.label = "Cleaning up..."
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.