AnsweredAssumed Answered

Pythonaddins not working for ArcGIS 10.3.1

Question asked by on Jun 8, 2015
Latest reply on Jun 18, 2015 by


I wrote a python tool using pythonaddins in ArcGIS 10.1. The tool works perfectly on ArcGIS 10.1 and 10.2. But I am unable to run the tool on ArcGIS 10.3.


Here is my python code snippet:


def onMouseDownMap(self, x, y, button, shift):
        #setup workspace location
        arcpy.env.workspace = r"" + self.inFile 
        #list all rasters
        rasters = arcpy.ListRasters("*", "TIF")
        #CSV file
        csv_file = arcpy.env.workspace + "\output.csv"
        #define output rows list
        rows = []
        #define output layers list
        layers = []
        #loop through all raster files and get cell values
        for raster in rasters:
            result = arcpy.GetCellValue_management(raster, "{} {}".format(x, y), "1").getOutput(0)
        #open the csv file and append values for each click on the raster map
        with open(csv_file, 'a') as outcsv:
            #configure writer to write standard csv file
            writer = csv.writer(outcsv, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL, lineterminator='\n')
            #print x, y in csv
            writer.writerow(['x', 'y'])
            #print x, y location in csv
            writer.writerow([str(x), str(y)])
            #print Layer, Value in csv
            writer.writerow(['Layer', 'Value'])
            #get row length
            rowlen = len(rows)
            #loop through the rows and print output to csv
            for i in range(0, rowlen):
                writer.writerow([layers[i], rows[i]])


And here is my config.xml file look like:


<ESRI.Configuration xmlns="" xmlns:xsi="">
    <Description>A python addins tool to get cell value of raster files</Description>
    <Author>Yamin Noor</Author>
        <Target name="Desktop" version="10.1" />
    <AddIn language="PYTHON" library="" namespace="GetRasterCellValue_addin">
                <Tool caption="GRCV" category="GetRasterCellValue" class="GRCV" id="GetRasterCellValue_addin.GRCV_1" image="Images\Other.png" message="Get Raster Cell Value" tip="Use this tool to get raster cell value">
                    <Help heading="Get Raster Cell Value">Get Raster Cell Value</Help>
                <Toolbar caption="GRCV" category="GetRasterCellValue" id="GetRasterCellValue_addin.GRCV" showInitially="true">
                        <Tool refID="GetRasterCellValue_addin.GRCV_1" />


I am not sure if changing the target version (to 10.3) in config.xml would make any difference. i.e

<Target name="Desktop" version="10.1" />




Message was edited by: Yamin Noor