|
POST
|
This is never true so you are not stepping into the update line. if eZoneNameString == [snName]: I also think you may be confusing lists and dictionaries.
... View more
04-02-2014
08:13 AM
|
0
|
0
|
1310
|
|
POST
|
You are attempting to add the addLayer variable which is a list of layers. And you are iterating over a single layer of your flyrList variable. I think you are getting your variable names confused.
... View more
04-01-2014
11:57 AM
|
0
|
0
|
885
|
|
POST
|
Are you looking for a simple geographic distance or using a transportation network of some kind?
... View more
03-31-2014
02:30 PM
|
0
|
0
|
2216
|
|
POST
|
Yes that adds a significant layer of complexity. What I would recommend is getting one combobox to work as you want, ignoring the rest. Once you know exactly how a combobox works you can create the rest fairly easily. I would recommend adding an onClick function to a button that just calls an arcpy.AddMessage() with the value of your combobox for testing. An alternative is to add your working toolbox to your addin. See this post for details. http://forums.arcgis.com/threads/89502-Python-add-ins-vs.-.NET-add-ins?p=319191&viewfull=1#post319191
... View more
03-12-2014
02:32 PM
|
0
|
0
|
2205
|
|
POST
|
And remember when you access your combobox you need to first have assign it properties through the class level self variables. You might be missing this part in your combobox class. def onSelChange(self, selection): self.sel = selection Then get the selection in your other classes like this. combobox.sel
... View more
03-12-2014
01:50 PM
|
0
|
0
|
2205
|
|
POST
|
print combobox? Are you trying to run this in an IDE? That won't work for addins. You'll only be able to reference the class values via the ID when it is installed as an addin. What is your end goal for this addin?
... View more
03-12-2014
01:39 PM
|
0
|
0
|
2205
|
|
POST
|
Then you probably changed it manually. Check in the addin assistant what the ID is for your combo box class. All you need are in the help docs. http://resources.arcgis.com/en/help/main/10.2/index.html#/combo_box/014p00000028000000/
... View more
03-12-2014
01:19 PM
|
0
|
0
|
2205
|
|
POST
|
You need to use the ID from the addin assistant. In your case it is called 'combobox'
... View more
03-12-2014
12:15 PM
|
0
|
0
|
2205
|
|
POST
|
You should be able to do that easily as a parameter. Are you creating a custom GUI or using Esri addins/tools? Also, have you tried CreateDatabaseConnection_management()? I use them for the direct connects. I did have some other issues actually with creating connection files and referencing a default version. Had to use arcobjects to get around it.
... View more
03-12-2014
10:03 AM
|
0
|
0
|
2805
|
|
POST
|
As Filip suggested, use os.remove(). That is the standard method of deleting files in Python on Windows. From the help: If the specified item is a workspace, all contained items are also deleted. Even though it also says. Deleting a database connection file does not delete the ArcSDE database. A database connection file is simply a shortcut to the database. Bottom line is I would never use arcpy.Delete_management() to delete anything but a feature class.
... View more
03-12-2014
09:48 AM
|
0
|
0
|
2805
|
|
POST
|
I'm not sure exactly, but try running this. Is it duplicating your entire list each time? import os
import arcpy
workspace = r"C:\working\roger"
output = r"C:\testlist.txt"
def inventory_data(workspace, datatypes, output):
"""
Generates full path names under a catalog tree for all requested
datatype(s).
Parameters:
workspace: string
The top-level workspace that will be used.
datatypes: string | list | tuple
Keyword(s) representing the desired datatypes. A single
datatype can be expressed as a string, otherwise use
a list or tuple. See arcpy.da.Walk documentation
for a full list.
"""
with open(output, "w") as outFile:
for path, path_names, data_names in arcpy.da.Walk(
workspace, datatype=datatypes):
for data_name in data_names:
outFile.write(os.path.join(path, data_name) + os.linesep)
inventory_data(workspace, "Any", output)
Edit: I think I see the issue, you have too many loops here. Try my revised code above. Edit2: Silly me the issue is just the lijn variable keeps building up with each loop. Just remove that entirely. import os
import arcpy
workspace = r"T:\test"
output = r"H:\testlist.txt"
def inventory_data(workspace, datatypes):
"""
Generates full path names under a catalog tree for all requested
datatype(s).
Parameters:
workspace: string
The top-level workspace that will be used.
datatypes: string | list | tuple
Keyword(s) representing the desired datatypes. A single
datatype can be expressed as a string, otherwise use
a list or tuple. See arcpy.da.Walk documentation
for a full list.
"""
for path, path_names, data_names in arcpy.da.Walk(
workspace, datatype=datatypes):
for data_name in data_names:
yield os.path.join(path, data_name)
with open(output, "w") as outFile:
for f in inventory_data(workspace, "Any"):
outFile.write(f + os.linesep)
... View more
03-12-2014
09:13 AM
|
0
|
5
|
1427
|
|
POST
|
That should work. Are you sure you only have one data frame? If you are getting to the point of the selection working properly I don't see what would be causing these issues. Try removing, recreating, and reinstalling the add-in. Maybe it is still hanging on to an older version. Are you getting any error messages? You could also try this to see if you get any different behaviour. df.zoomToSelectedFeatures() As a side note, this would be my preferred manner of doing the pan. df.extent = df.panToExtent(layer.getSelectedExtent())
... View more
03-12-2014
07:14 AM
|
0
|
0
|
1418
|
|
POST
|
Very nice, I'll see if there is anything I can contribute that isn't already included. Just to note however, try to ensure we follow PEP8 and Python 3 forward compatibility when possible.
... View more
03-12-2014
06:58 AM
|
0
|
0
|
2444
|
|
POST
|
ERROR 000539: SyntaxError: EOL while scanning string literal (<expression>, line 1)
That is an error with the expression format itself. Double check your field names and that you are using Python instead of VB.
... View more
03-04-2014
01:13 PM
|
0
|
0
|
1720
|
|
POST
|
You can create points along your line by creating an empty point feature class and using editor > construct points and input your desired distance and selecting your empty point template. With that you can use your new point feature class to load into the Get Cell Value tool. See the help here. http://resources.arcgis.com/en/help/main/10.2/index.html#//01m60000000n000000 http://resources.arcgis.com/en/help/main/10.2/index.html#//0017000000m8000000 You will need to loop through each point as input as there doesn't seem to be a bulk option.
... View more
03-04-2014
10:11 AM
|
0
|
0
|
472
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|