POST
|
Alternatively you could do something like this, inside your action set the program/script to path of the 32 bit python exe and in the Add arguements set it equal to the path to the python script. You could also then add additional arguements if your python script takes arguements. [ATTACH=CONFIG]22457[/ATTACH]
... View more
03-07-2013
03:03 PM
|
0
|
0
|
639
|
POST
|
Karl, Is the ID of the button associated with ButtonClass2 also called ButtonClass2 or is it just the class name. In the config file you will find the id, it should be something like MyAddin.button2. As the help topic says you don't need to provide the namespace, so it would just be button2.enabled = False.
... View more
02-28-2013
01:53 PM
|
0
|
0
|
151
|
POST
|
I understand, unfortunately it is not likely to change. Although it seems like you are making simple changes, this is a different level of customization you are making when you are building UI elements and application extensions. It just requires a restart of the application to take affect. This is essentially the same workflow you need to follow when building and testing .net add-ins as well.
... View more
02-20-2013
01:52 PM
|
0
|
0
|
354
|
POST
|
Hi Mike, Yes that is the workflow you need to follow in order to make changes to your add-in.
... View more
02-20-2013
01:25 PM
|
0
|
0
|
354
|
POST
|
The advantage of 64 bit processing over 32 bit processing is generally not speed. The only times you would really see a speed improvement is if you are seeing a large number of hard faults by the process or in other words the process is exceeding the amount of RAM available and is forced to read/write to disk. More likely the advantage you will find is the ability of a process to complete succesfully where in the past it may have failed with an out of memory error, this really only applies to memory intensive operations. Slight differences in speed of the process may be better attributed to differences in other processes running at the same time requiring time from the CPU and Disk.
... View more
02-19-2013
07:12 AM
|
0
|
0
|
457
|
POST
|
Hi Jeff Thanks for the reply basically the idea is to load previous .rlf reports, update them through running them and saving them. the process has to be automated say to be done once per week automatically, so my outlook can email (scheduled emails) the updated reports to relevant people... I'm not sure if ExportReports can do this, besides I 'm new to scripting in Python... Do you think this function can solve the issue? Kind regards Ray Yes, thats exactly what the ExportReport function does, check out the code samples at the bottom of the help topic they are passing in a layer, the rlf, and then specifying where to output the report.
... View more
02-14-2013
12:50 PM
|
0
|
0
|
314
|
POST
|
You can just use the following code: rows = arcpy.da.SearchCursor(fc, ("SHAPE@", "*")) This will return a tuple where the first item is the geometry followed by all the fields from the feature class. It will still contain tuple of coordinates like you saw before, but you can just ignore this. We did this because returning the full geometry is slower than just the coordinates of the centroid.
... View more
02-13-2013
11:52 AM
|
0
|
0
|
413
|
POST
|
Szymon, Thank you for your work on this one and narrowing down the problem. This is a bug and I have gone ahead and logged it into out system, NIM089008. As a couple of workarounds, if you are at 10.1 I found that the new Data Access module cursors did not have the same issue: http://resources.arcgis.com/en/help/main/10.1/#/SearchCursor/018w00000011000000/ In addition, I found that if I ran your script tool in the background, the problem did not occur either. I apologize for the inconvenience of this issue.
... View more
02-12-2013
08:49 AM
|
0
|
0
|
152
|
POST
|
Chris, regardless of the slight difference in code, the "old" way has worked for ages. The InsertCursor is pointing at a newly created Fc inside a Fd, so seems carry with it all those good things defined by the Fd. These polygons are being created in a GCS and are quite small. About 800m by 300m in UTM projected space. Approx 0.007 of a degree and less. So, you were correct that some rounding / resolution issue was the problem with the da.InsertCursor way. Its just that the da.InsertCursor isn't "aware" of the spatial resolution / crs of the feature it is inserting into. The old InsertCursor plainly was! Cheers, N Neil, I guess what I am trying to say is the rounding occurs at this line in the code: polygon = arcpy.Polygon(array) If you were to inspect the geometry of the polygon object you would find this to be the case. It is not the cursor that is rounding the geometry. When you use the insert cursor you are just adding the already rounded geometry. In your old code you never create a polygon object: FcPoly = OutCur.newRow()
FcPoly.setValue("PMLNo", k)
FcPoly.shape = array You just pass in the array of point objects into the Shape field of the row, at this point the polygon is constructed and it takes on the spatial reference defined by the feature class. If you were to construct the polygon object from the array before passing it into the Shape field you would see the same problem.
... View more
02-06-2013
07:02 AM
|
0
|
0
|
813
|
POST
|
I can see the arguement for logging an enhancement when exporting a model to a python script using the "Database Connections" keyword in the path that we automatically write out the full path to the connection file instead of using just Database Connections. However targeting the wrong version of python when executing your scripts is the much bigger issue here. You would see the same problem if your script tried to process a personal geodatabase feature class, because PGDB is not supported with ArcGIS Server, or if you tried to use some of the metadata tools because they are not supported in Server. We can't do anything about this when exporting the python script because a python script itself cannot explicitly target a version of python to run against at python 2.7. Here is a python bug that describes this limitation and the ultimate solution at Python 3.3. http://bugs.python.org/issue4485 This all comes back to file associations. If you installed ArcGIS Desktop first and then installed ArcGIS Server, the file associations for a .py file would be set to the 64 bit version of python 2.7 or the last version of python installed, so if I double-click to the script it would execute against Python 2.7 64 bit. Let's say I then installed stand-alone Python 3.0, then the file associations for .py would be set to Python 3.0 and if I double-clicked to run my script it would fail when importing arcpy. You can modify the file associations of .py files by right-clicking one, selecting open with>choose default program and browse to the version of python you want to associate. We are currently working on a knowledge base document to describe this issue and the process for modifying file associations/targeting the right version of python.
... View more
02-05-2013
02:14 PM
|
0
|
0
|
516
|
POST
|
This is not a bug in the software. When you run python against the 64 bit install of python and arcpy, you are running against the Server install and Server doesn't know about the relative location of the "Database Connections" which lives under the Desktop10.X folder in your user profile. If you publish a geoprocessing script tool to Server that has a hardcoded path to Database Connections we actually copy the connection file as part of the package and modify the script to point to the packaged connection file. So your options are to reference the full path to the connection file or always ensure you are running the script against the 32 bit or Destkop install of python.
... View more
02-05-2013
09:49 AM
|
0
|
0
|
516
|
POST
|
I just installed 10.1 on my PC. Now when I run my Python script it no longer recognizes any connection coded like "Database Connection\Connection to ...". These connections work in ArcMap and ArcCatalog. When I create a Model using these connections, the model works. When I export the Model to a Python script the model it fails. If I replace the "Database Connections\..." path prefix with something like "C:\Users\SomeUser\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\..." it works. In short Python is not resolving "Database Connections" to the actual location of the connections (ie. "C:\Users\SomeUser\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog"). I have SP1 installed on the ArcGIS 10.1 for Desktop. My C: drive has both a "Python26" and a "Python27" directory. Maybe its getting confused where to run Python? Also it looks like ArcCatalog/ArcMap run as 32 bit where as Python runs as 64-bit. Is there something I can do to configure the 64-bit side to find "Database Connections". Please help! Thanks! How are you running the python script? To be sure you are running against the same version of python ArcGIS Desktop will run you can explicitly call the version of python from a command prompt and then pass in the path to the script. This blog talks about it, but specifically in regards to targeting the 64 bit install of python. You can do the same for the 32 bit install. http://blogs.esri.com/esri/arcgis/2012/11/12/python-scripting-with-64-bit-processing/
... View more
02-04-2013
02:01 PM
|
0
|
0
|
516
|
POST
|
I would just create list variable, append to it in the loop, after the loop completes create a set from the list and then assign it to the items property of the combo box.
myList = []
for row in sc:
myList.append(row.getValue(column_Lot)
mySet = set(myList)
combobox2.items = list(mySet)
combobox2.enabled = True
... View more
02-04-2013
01:40 PM
|
0
|
0
|
629
|
POST
|
Hi Chris, I am creating geometries using the data access module similarly but I see strange performance. The first time I created the tool from the script that reads xy from one shapefile and inserts to another. When tested with 2000 points it was completed a second. Then I started testing with other shapefiles and changed the geometry source from shapefile to Access database table. Now the tool takes 13 seconds with even lesser number of points. I retested with the original shapefile, still slow performance. I am deleting the cursors at the end of the Execution. Is there anything else I need to clear ? Appreciate your help! I am not sure why you are seeing a difference in performance. You might want to contact support to try to troubleshoot this issue further.
... View more
02-04-2013
01:04 PM
|
0
|
0
|
813
|
POST
|
If you convert a list to a set it will return only unique values: >>> list = [1,1,5,5,3,8,9] >>> set(list) set([8, 1, 3, 5, 9]) >>>
... View more
02-01-2013
01:15 PM
|
0
|
0
|
629
|
Title | Kudos | Posted |
---|---|---|
1 | 06-02-2011 03:59 PM | |
1 | 06-10-2011 08:37 AM | |
1 | 06-08-2011 04:27 PM | |
1 | 06-07-2011 03:11 PM | |
1 | 01-31-2013 02:36 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:22 AM
|