All Questions
315
questions
0
votes
0
answers
10
views
Python IDLE crashes while trying to remove a Layer from an mxd containing a lot of layers using ListDataFrames
Problem
My ArcGIS 10.8.1 crashes whenever I try to open an MXD project that contain Basemap layers.
I need a script to remove Basemap layers without opening these MXDs but Python IDLE also crashes ...
0
votes
2
answers
95
views
Updating data sources in .aprx files
I am about to break a lot of data sources in our team's .aprx files because we are overhauling the places we are storing our data. Our data is stored in shapefile and file geodatabase formats.
Is ...
0
votes
2
answers
163
views
arcpy.mapping ListLayers to arcpy.mp listLayers
I am working on updating a Python 2 script (arcpy.mapping) to a Python 3 script (arcpy.mp).
I've successfully updated the following:
aprxFile=r"G:\usr\Drinking Water Programs\Monroe 2023-02\Maps\...
2
votes
1
answer
358
views
Turning off layer visibility in ArcGIS Pro with Python
I have code that exports several maps. For a set of maps, I want to make sure one layer used in a previous map is turned off. I don't want to remove it completely.
Anyone know what I am doing wrong?
...
0
votes
0
answers
71
views
Apply the same symbology to multiple raster layer
I have many raster layers and I need to apply same symbology to all raster layer. I used this code and the error was:
Runtime error Traceback (most recent call last): File "", line 8, ...
1
vote
2
answers
348
views
Adding a layer to multiple maps within the same project with ArcPy [duplicate]
Using ArcGIS Pro 3.0
I am looking to apply a definition query on a feature class from a geodatabase and add it as a layer onto 3 maps. My thought was to use a for loop to loop through my maps and add ...
1
vote
2
answers
935
views
Selecting layer from the current map using Python on ArcGIS Pro
I'm trying to learn how to use Python notebooks on ArcGIS Pro. I'm trying to add a new field to one of the layers on my Map. I added the layers to my map online. This is the code I have so far:
import ...
0
votes
2
answers
78
views
ArcPy RemoveLayer doesn't work
I have a task where I have several polygons and I have several data frames in which each has a different temporal image. I have linked the data frames to one main data frame in which I add a polygon ...
1
vote
1
answer
194
views
How iterate with cim.featureTable.fieldDescriptions?
I have the next code:
#Importar librerías necesarias
import arcpy
import pandas as pd
#Obtiene el Mapa activo
aprx = arcpy.mp.ArcGISProject("CURRENT")
current_map = aprx.activeMap
...
0
votes
0
answers
195
views
Managing style file in ArcPy using ArcGIS Pro
I am trying to update a geoprocessing service that was in ArcMap to ArcGIS Pro. The geoprocessing services use a style file for its legend and I want to update certain legends but I have no idea how. ...
2
votes
1
answer
144
views
If lyr.visible = True
In this very simple code, my program keeps failing at line 4, if lyr.visible = True:, yet if I use Print lyr.visible instead, I receive the response "True" or "False" for each ...
1
vote
0
answers
504
views
ArcPy Apply Symbology from Layer is not working in script
I'm trying to apply symbology on all the layers in my TOC that match a certain string. The apply symbology step of the script makes the layers in TOC glitch, which means it gets executed but the ...
0
votes
2
answers
807
views
ArcPy command to get the number of features in map layer
I am looking for an ArcPy command to get the number of features in map layer.
There are posts on how to check the number of features in the source of the map layer with
arcpy.GetCount_management(lyr....
0
votes
1
answer
114
views
Adding feature class to active map from geodatabase
An extension of the question answered here:
Adding feature class to Map in CURRENT project using ArcPy in ArcGIS Pro?
This method adds the feature class to the first map in the project, but what if I ...
1
vote
1
answer
2k
views
Using ArcPy to add layer to map
I am having trouble adding my result to the current map using ArcPy. I keep getting this error problem, "ValueError."
Here is my script:
Result = arcpy.analysis.Clip('FeatureClipped','...