ArcGIS python add in to call python script for importing mdb data

المشرف العام

Administrator
طاقم الإدارة
im trying to change from a .net toolbar to a python toolbar in ArcGIS 10.2 and am having some difficulty. I have some stand alone python script which i know works and does what i need to do but i cant work out how to get the add in button to call this script or how to incorporate the script in with the button add in script.

import arcpy import pythonaddins class ImportCSVFile(object): """Implementation for Import_CSV.button (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): script1 = "C:\Users\xxx\Documents\AddIns\pythonAddin\Install\xxx" execfile(script1) ive also tried using os.startfile(xxxxx) instead of script1 = "xxxx" and execfile(script1).

I dont get an error but the button doesnt do anything. Does anyone have any ideas of how to get this to work?

Thanks



أكثر...
 
أعلى