Skip navigation
All Places >

python snippets

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

Recent Activity

curtvprice
see http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000066000000 would be nice to have the option of removing ALL joins from a table or feature class programatically just like you can from the GUI instead of having to remove them individually. Instead of passing in the name of the join as a string, use a '*' or '#' to… (Show more)
TinaEsri
When I run >>>arcpy.Near_analysis("ACN_Select","Derden","150 Meters", "NO_LOCATION", "NO_ANGLE","PLANAR") in the python window in ArcMap 10.4, it returns the correct numbers in the field NEAR_DIST. However, if I run the same in PyScripter: import arcpy arcpy.env.workspace = "C:\\Geoplay\\GLO\\Output.mdb" arcpy.env.overwriteOutput = True if… (Show more)
in python snippets
ramaz65w
Automating the Publishing through arcpy scripting and modifying the properties of the SDDraft by xml parsing. Able to change most of the properties but when running the script for recycleInterval property I'm getting this error :   if key.firstChild.data == 'recycleInterval': key.nextSibling.firstChild.data = 1 AttributeError: 'NoneType' object… (Show more)
in python snippets
donaldsonk
Hi I'm looking for a python script to populate an ID field in ACRGIS 10.2 with a sequential number that resets when the value of site field changes. e.g. Site      ID SIte A   0001 Site A   0002 SIte A   0003 Site A   0004 SIte A   0005 Site B   0001 SIte B   0002 Site B   0003 Site C   0001 SIte C   0002 ...           ..... I've… (Show more)
in python snippets
behClevest
  I need to add all features within a dataset called MainSt in a file geodatabase which is stored at following directory C:/Temp/Roads.gdb to current map. using following code I am able to add them one by one but can you please let me know how I can loop and add them dynamically     mxd = arcpy.mapping.MapDocument("CURRENT")     df =… (Show more)
in python snippets
behClevest
I am using this code to add a feature from GeoDatabase dataset to an open MXD file   import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Temp\Streets.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] targetGroupLayer = arcpy.mapping.ListLayers(mxd, "Main", df)[0] addLayer = arcpy.mapping.Layer(r"C:\Data\NetMap.gdb\Streets\OneWay")… (Show more)
in python snippets
behClevest
I am able to run Geometric Network Trace by using following ArcPy script but I also need to add Trace result into the map. Can you please let me know how I can add the result(graphic/geometry) to the map. import arcpy arcpy.env.workspace = r"E:/Utility/Sample/Montgomery.gdb" # Local variables: G_N =… (Show more)
in python snippets
behClevest
Can you please let me know how we can set current map to Full Extent using ArcPy? import arcpy import arcpy.mapping # Set the Map to be Full Extent mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.Set-To-Full_Extentlike what the is doing on main toolbar in the ArcMap?
in python snippets
jfrey07259
I am trying to create a simple code that will select features in a shapefile based on the query {anything within the ATTRIBUTE field that starts with the letter 'P'}. Here the problematic line:   arcpy.SelectLayerByAttribute_management("NJ_Wetlands", "NEW_SELECTION", """"ATTRIBUTE" LIKE P%""")   I know I could do this simply in the toolbox GUI,… (Show more)
in python snippets
Load more items