POST
|
Mark, No its still not working for me on ArcMap 10.3+ but works on ArcMap 10.1 and 10.2. I now have another issue to deal with pythonaddins tool. I developed another separate tool to create rectangle fishnet. It works like charm but after exactly 9 clicks on the map ArcMap crashes to desktop. I have tested this on ArcMap 10.1 and 10.2. Yamin
... View more
06-18-2015
01:32 PM
|
0
|
0
|
495
|
POST
|
Is there a pythonaddins tool or script with which I can click on a feature class polygon to be selected and export some specific attributes to a csv? My must have requirements are: 1. Pythonaddins, so that I can use the tool and click anywhere on polygon feature class. 2. There could be multiple feature classes, so I need to loop through all of them to get specific attributes to export. [I think this would be very similar to identifier tool. The reason why we need to custom develop this, is to be able to export data to a csv file whenever a click event occurs.]
... View more
06-15-2015
09:44 AM
|
0
|
1
|
2812
|
POST
|
Hi, 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)
layers.append("{}".format(raster))
rows.append("{}".format(result))
#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, rows])
And here is my config.xml file look like:
<ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>GetRasterCellValue</Name>
<AddInID>{c509440b-c55e-46bb-b443-a61a2b824da2}</AddInID>
<Description>A python addins tool to get cell value of raster files</Description>
<Version>0.1</Version>
<Image>Images\Other.png</Image>
<Author>Yamin Noor</Author>
<Company>XYZ</Company>
<Date>06/08/2015</Date>
<Targets>
<Target name="Desktop" version="10.1" />
</Targets>
<AddIn language="PYTHON" library="GetRasterCellValue_addin.py" namespace="GetRasterCellValue_addin">
<ArcMap>
<Commands>
<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>
</Tool>
</Commands>
<Extensions></Extensions>
<Toolbars>
<Toolbar caption="GRCV" category="GetRasterCellValue" id="GetRasterCellValue_addin.GRCV" showInitially="true">
<Items>
<Tool refID="GetRasterCellValue_addin.GRCV_1" />
</Items>
</Toolbar>
</Toolbars>
<Menus></Menus>
</ArcMap>
</AddIn>
</ESRI.Configuration>
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" /> Thanks Yamin Message was edited by: Yamin Noor
... View more
06-08-2015
10:48 AM
|
0
|
5
|
4211
|
POST
|
Hi I wanted to see if I can use clustering for my dynamic layers. I am using this statement to load 10 sublayers under Data Layers category. All I want is to use clustering for some specific layers using layer ids. <layer label="Data Layers" type="dynamic" visible="true" alpha="1" url="http://url_here/MapServer"/> I am guessing I have to use sublayer & clustering tag in combination. But how? If anyone knows, it will be a great help. Thanks Yamin
... View more
11-01-2013
10:39 AM
|
0
|
2
|
2172
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|