0
votes
1answer
28 views

Setting Layer Properties Using ArcPy

I am writing an ArcPy script that creates a Point Density Raster file, and then changes the following properties in the resulting layer: Symbology Classified Classes = 10 Classification Method = ...
-2
votes
0answers
55 views

Using python script to change group layers data source path

I am trying to implement the python script supplied by GetSpatial here: Python Script to change Group layers and am having some difficulties. import arcpy, datetime, os, io, sys def ...
0
votes
1answer
46 views

ArcPy - Add Layer from Cursor Selection

I am trying to add layers from the fields of a reference layer using select by location and a cursor. Also, want to prompt the user with a message box asking if they want to add the selected by ...
1
vote
1answer
83 views

Delete Turned Off (Unchecked) Layers from Arcmap with Python

I have about 100 figures that have been updated countless times and a lot of the old data was left in each .mxd but was only turned off (unchecked) and not removed. I would like to remove these ...
4
votes
1answer
123 views

Is it possible to store a default symbology layer in an arcpy add-in?

Since arcpy is limited in how symbology can be manipulated, I was curious to know if a symbology layer can be stored in an arcpy add-in. Does anyone know if it is possible to store a .lyr file, or ...
4
votes
1answer
472 views

What is Python equivalent of ModelBuilder's Iterate Feature Selection?

My data consists of two featureclasses: Points = points representing trees Polygons = Polygons representing % canopy area by area. Each polygon in the FC has a % canopy measurement in the ...
0
votes
2answers
58 views

Trouble using saveACopy with group layers [closed]

This code works fine on layers in the TOC that are not group layers, but errrors out if there are any group layers in the TOC. import arcpy, re, os arcpy.env.overwriteOutput = True #loop through ...
0
votes
2answers
90 views

How to save all layers in a MXD with arcpy

I'm using this code and it does not work. I simply want to save the layer after I repair the source/symbology/etc without manually clicking, save as layer file and overwriting the file. import arcpy ...
1
vote
1answer
227 views

How to convert shapefile to KML file using ArcPy? [duplicate]

Python script that checks to see if a specific layer file exists in the current workspace and, if it does, converts the layer file to a KML file. Does it work with a shapefile? Code so far: for file ...
0
votes
1answer
265 views

Why does arcpy.mapping.Layer give Runtime error: CreateObject Layer invalid data source?

I want to connect an existing .lyr file to a variable defined as lyr2. lyr2 = arcpy.mapping.Layer(r"C:/Iso100Red.lyr") Although its a .lyr file I´ll get this Errorcode: Runtime error : Object: ...
1
vote
1answer
446 views

Creating a layer after using SelectLayerByAttribute_management

Is it possible to use an existent layer to do a selection by attributes without having to use MakeFeatureLayer_management first? Because I already have a layer with the same name as the feature class ...
6
votes
1answer
444 views

How to add layer with ArcPy and retain feature class metadata (like Credits) in layer properties?

I have multiple feature classes in a geodatabase, each feature class has metadata including a Description, Credits, and other information. If I use the 'Add Data' button in ArcMap 10.1 to add one of ...
0
votes
1answer
435 views

Feature Layer Selections

I'm new to arcgis and arcpy, so some of my lingo and terminology may be off. I have a script that takes a feature layer as an ainput. From there I want to be able to count the number of selections in ...
2
votes
1answer
464 views

How to use arcpy.mapping to batch export layer to KML?

I am trying to export map layers from an MXD to KML using arcpy with the following code: import arcpy, os, sys, traceback arcpy.env.overwriteOutput = True mxd = ...
3
votes
1answer
272 views

List Elements or Datasets of a given Layer

I am sorry of this might sound like a noob question but I cannot find any answer from google. I used arcpy to do batch processing of Network Analyst - Make Service Area layer of thousand of stores. ...