Skip navigation
All Places >

python snippets

Log in to follow, share, and participate in this socialgroup.

Recent Activity

I am try to iterate over 3 feature datasets in 1 gdb and update a field value in all of the feature classes to "No". ArcMap 10.4.1 Standard license. Windows 7 Here is my code.  import arcpy arcpy.env.workspace = r"PATH HERE" #list of datasets datasets = ["WaterDistribution", "WastewaterSystem", "Stormwater"] #field to update updateField =… (Show more)
in python snippets
I need some help with some nested Search/Insert Cursors adding data to a table and to a point feature class. What I have: - I have one big table with stations 1-n with for example 10,000 rows for each station. - A point feature class in a file geodatabase. What I want: - I want to copy the rows for each station into a newly created table (all… (Show more)
in python snippets
Hi all,   I would modify the properties of all layers in an mxd setting, for instance, all the fields as non editable. The following script seems to work:   import arcpy      mxd = arcpy.mapping.MapDocument('path-to-mxd') df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0] layers = arcpy.mapping.ListLayers(mxd,"*",df)   for lyr in layers:… (Show more)
in python snippets
Is that really possible to control Python Toolbox from arranging the params alphabetically, at least the category?
in python snippets
Hello,   I want to create multiple ring buffer starting with 0.5 m, 1 m, 1.5 m, 2 m,..... up to 500 m around point object. I try to do it by Arcpy - 'MultipleRingBuffer_analysis', unfortunately, it takes very long time and end up with displaying an error. (But I try it 10 m buffer interval 10 m, 20 m, 30 m, .....500 m, it nicely works)   Does… (Show more)
in python snippets
I'm stumped on how to figure this one out, i have a geometric network that manages eight layers that we uses to manage our storm water system.  as part of a CCTV inspection program/project we are trying to assign a number (squence) from the outfall (lowest point downstream) of a system to its highest.     I have looked into trying to query the… (Show more)
in python snippets
I struggled to find a simple solution to this, so thought I'd put it up to help the next person.   What I was trying to do was iterate through the rasters which formed my mosaic and retrieve the acquisition date from each of them. In ArcMap, you would find this by opening the attribute table and clicking through the little arrow within the raster…
in python snippets
Have you been meaning to try out the ArcMap Python window, but just aren’t sure how to start? Well, the five code snippets below are a great tool to familiarize yourself with the Python window and the arcpy.mapping module. Make a copy of an MXD file and move it somewhere to test out these snippets. You’ll soon see how useful a few Python tricks… (Show more)
Load more items