POST
|
Hi Jai, That did the trick! Thanks very much, it works like a charm, and doesn't even need threading. All the best, Jelmer
... View more
05-06-2015
07:38 AM
|
0
|
0
|
1518
|
POST
|
Hi Jai, thanks for your reply. I'm currently not using any other GUI framework than ArcGIS itself, using the python add-in wizard: https://www.arcgis.com/home/item.html?id=5f3aefe77f6b4f61ad3e4c62f30bff3b And by using a while loop in the code the tool and ArcGIS hangs. Here is a simple snippet example: import arcpy
import pythonaddins
class ButtonClass1(object):
"""Implementation for tryaddin_addin.button (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
# the while loop
global switch
while switch == 0:
print 1
global switch
class ButtonClass2(object):
"""Implementation for tryaddin_addin.button_2 (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
# turn off the while loop
global switch
switch = 1
switch = 0
... View more
05-05-2015
08:13 AM
|
0
|
0
|
1518
|
POST
|
As far as I've seen online I can answer my question: the answer is no.
... View more
05-05-2015
03:01 AM
|
0
|
0
|
419
|
POST
|
I'm building a python add-in for ArcGIS desktop with a button which runs a while loop. Another button should close the while loop. In the while loop there is a continuous process going on which is important for the functionality of the add-in. But unfortunately the while loop causes the add-in, and therefore ArcGIS desktop, to hang. I have tried time.sleep(.1) in the while loop. And I have tried the threading library. But nothing seems to work. I was hoping someone maybe had a suggestion? Thanks in advance!
... View more
05-05-2015
02:59 AM
|
0
|
4
|
5899
|
POST
|
I wasn't planning to use these data driven pages, but if they solve my problem I will of course. I'm merely interested to find out if there is an event listener available which triggers once a user zooms/pans the map.
... View more
04-27-2015
03:21 PM
|
0
|
0
|
419
|
POST
|
I'm trying to make a python add-in application extension which triggers once the map view extent has changed. But none of these functions seem to work: ArcGIS Help 10.1 Is this still possible?
... View more
04-26-2015
02:00 PM
|
0
|
3
|
3421
|
POST
|
I was able to solve the error. I changed: layer = arcpy.mapping.Layer('C:\path\shapefile.shp')
symbologylayer = arcpy.mapping.Layer('C:\path\symbologylayer.lyr')
arcpy.ApplySymbologyFromLayer_management(layer, symbologylayer)
Into: layer = arcpy.mapping.Layer('C:\path\shapefile.shp')
arcpy.ApplySymbologyFromLayer_management(layer, 'C:\path\symbologylayer.lyr')
The former code worked only on my PC, the latter code works on all PCs checked so far.
... View more
03-10-2014
06:16 AM
|
0
|
0
|
1160
|
POST
|
An ArcGIS 10.2 layerfile can be read by ArcGIS 10.1 Hi Xander, That was what I was trying to find out. If this is true then something else must cause the error. The add-in works in 10.2 and there the data types match. The symbology layer is the .lyr file and the other layer I make on-the-fly using arcpy. I will need to wait until I can debug on 10.1. Thanks for your reply, Jelmer
... View more
03-03-2014
01:53 AM
|
0
|
0
|
1160
|
POST
|
I'm working on a python add-in which includes a .LYR file with specific symbology. I use ApplySymbologyFromLayer_management to load a shapefile with this .LYR symbology in the ArcMap TOC. This works perfectly on my own testing PC with ArcGIS 10.2. But when I ask a test user to try the add-in on ArcGIS 10.1 the following error is returned: ExecuteError: Failed to execute. Parameters are not valid. ERROR 000968: The symbol layer does not match the input layer Failed to execute (ApplySymbologyFromLayer). I can't easily debug this problem on the test user system and therefore, as a first step, I would like to find out if a .LYR file made in 10.2 should be backwards compatible with 10.1? Thanks in advance!
... View more
02-28-2014
10:27 AM
|
0
|
3
|
4637
|
POST
|
Thanks! That did the trick! I needed to set self.enabled and self.editable to True.
... View more
02-04-2014
09:19 AM
|
0
|
0
|
401
|
POST
|
Using self.value it is possible to preset the value of the combo box (one of the values in the self.items list). But this value is not shown when the add-in is first loaded, you still see a blank combo box, even after self.refresh(). How can I show the selected value? This is not the most important functionality, but I think it would make the add-in I'm working on more easily understood by users.
... View more
02-04-2014
04:36 AM
|
0
|
2
|
833
|
POST
|
Hi Jeff, I added the code you suggested but then ArcMap 10 crashes... Jelmer
... View more
11-24-2011
01:35 AM
|
0
|
0
|
644
|
POST
|
Hello, I have two raster layers in my TOC of which the top one is semitransparent. They have the same size and extent. I would like to export this combined 'map' in it's full resolution. My first attempt uses File > Export Map. First I set the Dataframe width to be the rasters width. Next in Export Map I increase the DPI until the exported image width is around the width of the rasters. When I export ArcGIS 10 SP3 crashes. This has worked for me with ArcGIS 9.3. The second attempt is using python: import arcpy mxd = arcpy.mapping.MapDocument("mymxd.mxd") outTIFFpath = "out.tif" df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] arcpy.mapping.ExportToTIFF(mxd, outTIFFpath, df, df_export_width=46070, df_export_height=28126, resolution=2642, world_file=True, geoTIFF_tags=True) (the width of the rasters is 46080 and 46070 here is the best approximation I can get) The problem here is that the exported TIFF isn't correctly georeferenced. The resulting map is mostly white 'nodata' around the raster. How can I make sure the MapDocument goes to full extent before I export? Kind regards, Jelmer Oosthoek
... View more
11-11-2011
06:02 AM
|
0
|
5
|
3341
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|