|
POST
|
The question is already answered, but I will write a bit more detail to hopefully help you understand: You have a "For" Loop, but inside the loop you only have the lines of code: print fc # Add two fields to hold the results arcpy.AddField_management (fc, "SFCount", "LONG") arcpy.AddField_management (fc, "MFCOUNT", "LONG") The rest of the code is not indented, so does not get included in the loop! So your script currently works as follows: For each FC: print FC add fields to FC On the last FC in the loop only: selection + calculate To fix, simply indent all code after your "For" loop
... View more
10-26-2016
06:45 AM
|
1
|
0
|
860
|
|
POST
|
Heres my code for making an SQL statement from a list with no error catching or anything: I use it with lists of ObjectIDs all the time to start my cursors fieldName = 'FIELD1' valueList = ['Value1', 'Value2'] where = "%s in ('" % fieldName where += "','".join(map(str, valueList)) + "')" print where FIELD1 in ('Value1','Value2')
... View more
09-27-2016
08:35 AM
|
0
|
0
|
395
|
|
POST
|
If it crashes on this line: arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION", + Next) Its because + Next (An Integer only) is not a valid SQL query. It looks much better further down: arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION", "Page = '" + text + "'")
... View more
09-27-2016
03:10 AM
|
0
|
0
|
1130
|
|
POST
|
100% duplicate of my question all the way! https://community.esri.com/thread/181642-arcpy-add-in-tool-deselect-tool Please add a method to the pythonAddins to let us select the basic "ArcGIS Select" tool at end of processing.
... View more
09-16-2016
05:15 AM
|
0
|
1
|
673
|
|
POST
|
I need something that will function on a tool OnRectangle event, feature attributes will then be looped to get unique values, for the user to make a selection. That was just a simple example for brevity. I think your toolbox show method should work for this!, one day I will try it out. (Hopefully I can pass something to the toolbox interface to populate data from my selected features!)
... View more
09-16-2016
05:14 AM
|
0
|
0
|
328
|
|
POST
|
I have not tried implementing this just yet, but my current plan for some advanced user input is to create a "OpenDialog" And programatically place some files in a folder and make it open in this location. (e.g Yes.txt, No.Txt, Other.txt) and let the user select a file from here. Maybe this would work (and they could rename the file before selecting?) I think Luke Pinners solution is probably better and the correct way to do it!
... View more
08-30-2016
04:51 AM
|
0
|
2
|
2390
|
|
POST
|
Yes that is what I am using. I found this so it doesnt look hopeful: https://community.esri.com/thread/88371 Its a bit of a pain, I have now to decide whether to code my tool as a "Selector if nothing is selected, or the tool if so", or just leave it as is! Neither is the ideal solution.
... View more
08-18-2016
02:29 AM
|
1
|
1
|
925
|
|
POST
|
I have an add-in tool created that works perfectly. Yehaw! It takes your input selection, takes the tools rectangle_geometry, does a load of clever stuff, then clears the selection as work is complete. Its time to make another selection, and use the tool to select your region again.,,, But I cant find any way to de-activate the tool or set it back to the standard ArcMap select tool after its job is done? Please help!? Its very user unfriendly as if they click again now, it will complain about no selection being present! I have tried using: self.deactivate() , but thats not an attribute of my tool :S
... View more
08-17-2016
05:01 PM
|
0
|
6
|
1995
|
|
POST
|
Very helpful thank you! I wont mark as correct answer, as ideally I would love to be able to create unique "Pages" on the web, to mirror the "pages" created offline, without my users having to query data. (Ideally a unique map for each page, with permissions on each page so I can connect individuals with their page, and not let them see others data)
... View more
05-11-2016
03:50 AM
|
0
|
3
|
3082
|
|
POST
|
Hello, I have 100 layers covering approximately 100 catchments (Geographic areas). We have setup data driven pages, to create 1 map per catchment, and using page definition query are able to filter the features to only the ones present within the catchment. (They have a catchment attribute). I now need to publish my 100 maps online, does anyone have any tips for how best to achieve this? Thoughts Do I need to publish an filtered service for every map??? All data has a catchment attribute so I really dont want to do this and spawn 1000s of published services. I can filter using ArcGIS online interface, but it will take hours to create each map applying the filter to each layer.
... View more
04-12-2016
04:55 AM
|
0
|
9
|
9381
|
|
POST
|
EDIT: Ok I think I understand a bit better after rereading, I think what you are trying to do should work, however I have had issues doing it like that! My implementation wasnt how I wanted it to be, but went like this: (Code may only work with standard InsertCursor, not the .da version!) # Insert the current superstring into the output feature class
cursorFieldList = dissolveFields
cursorFieldList.append("SHAPE@")
insertCursor2 = arcpy.da.InsertCursor('SuperStrings_temp_out', cursorFieldList)
#Create empty template row object
insertRow = insertCursor2.newRow()
multipartPolyline = arcpy.Polyline(superstringPartsArray)
#Set geometry
insertRow.shape = multipartPolyline
#Set other fields
insertRow.setValue(field1, row.getValue(field1))
insertRow.setValue(field2, row.getValue(field2))
insertCursor2.insertRow(insertRow)
del insertCursor2, insertRow
... View more
03-04-2016
04:52 AM
|
2
|
1
|
3440
|
|
POST
|
Totally unrelated to your problem, but I noticed you are using string processing to build file paths. There is a built in python module that handles this for you, and works across operating systems etc if this is ever a concern. In simple terms, it joins parameters, adding a slash in between. fill_sinks = "{0}\\{1}".format(raster_workspace, "fil") Becomes: fill_sinks = os.path.join(raster_workspace, "fil") You can also do as many parameters as you like to build longer paths. fill_sinks = os.path.join(raster_workspace, "fil", "output", "test.shp") Returns: 'E:\Python\Temp\Model04\Layers04\fil\output\test.shp'
... View more
02-25-2016
09:07 AM
|
2
|
6
|
2820
|
|
POST
|
1) What line of your code corresponds to: File "<interactive input>", line 8, in <module> 2) Where do you populate the 'fields' variable? 3) Field maps could be replaced by an Append step in your code, create the template table with 2 fields within, and just use the append tool with Schema type set to "NO_TEST". We dont have enough information to diagnose easily sorry!
... View more
01-26-2016
05:21 AM
|
1
|
0
|
1856
|
|
POST
|
Your variable name indicates you may be passing a list of FCs to the clip tool, it can only clip 1 fc at a time. FCsToClip --> FCtoClip
... View more
01-25-2016
08:09 AM
|
1
|
0
|
878
|
|
POST
|
This is a topic of utmost importance! Please can you announce this officially somewhere ESRI? Or show me where it has been as my google skills are obviously bad. We are not in a position to begin using the latest software on live projects until we have reassurance that we will be able to continue to open our maps as you described here: SIngle Use License - if you discontinue maintenance, a user may request a release locked standalone license for Pro. Pro will not be eligible for updates. It will open *.aprx's and be locked to that release where maintenance was discontinued. One would still have access to ArcGIS Online/Portal services.
... View more
01-14-2016
08:55 AM
|
2
|
2
|
2306
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-29-2019 07:45 AM | |
| 1 | 05-13-2013 07:11 AM | |
| 1 | 05-24-2011 07:53 AM | |
| 1 | 05-22-2017 05:01 AM | |
| 2 | 07-29-2019 05:34 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-22-2024
10:40 AM
|