Skip navigation
All Places >

python snippets

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

Recent Activity

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
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 am trying to run this ArcPy example from ESRI TraceGeometricNetwork example 2    # Import arcpy module import arcpy # Local variables: Water_Net = "C:/GeometricNetworks/Montgomery.gdb/Water/Water_Net" Flags = "C:/GeometricNetworks/Montgomery.gdb/Water/Flags" Water_Net_2 = "Water_Net" # Process: Trace Geometric Network… (Show more)
in python snippets
behClevest
I am running Kivy and Python properly when it is only Kivy as import kivy kivy.require('1.0.6') from kivy.app import App from kivy.uix.label import Labelbut when I add ArcGIS Python library called ArcPy like below import arcpy import kivy kivy.require('1.0.6') from kivy.app import App from kivy.uix.label import LabelI am getting following… (Show more)
in python snippets
behClevest
I have a Transformer feature in a Geometric Network which has a field called `PhaseDesig` and it has five types of unique attributes [0, 1, 2,4,7] like this image   I used this code to generate Geometric Network   arcpy.CreateGeometricNetwork_management(Electric, "Electric_Net", "Power SIMPLE_JUNCTION YES;\ Fuses SIMPLE_JUNCTION NO; \… (Show more)
in python snippets
mailsivaprakash
Hi python snippets arcgis map clip_analysis tool is not working properly for Annotation layer provided the output in another projection system. Anyone else encountered this.   To recreate the issue:   Open python window   set outcoordinatesystem set to another. Try out clip_analysis for annotation layer. The output is not as expected. The… (Show more)
in python snippets
behClevest
Using ESRI Tutorial Data for Utility Network Tracing (Montgomery.gdb) which is a File Geodatabase and following Arcpy script  I am not getting any erro on running the script to find the path between two points in Flag (point) layer # Import arcpy module import arcpy # Local variables: gnVersionFDS_Net = "E:/Montgomery.gdb/Water/Water_Net" Flags =… (Show more)
in python snippets
DemersM
Hi,   I am looking for a way to create an Historical Marker programmatically with arcpy.   The archiving is enabled on a dataset in Oracle SDE.   I think, it's related with arcpy Version Toolset, but I can't find the documentation about this.   Thank you,   Maxime
Load more items