Skip to main content

All Questions

Tagged with
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 ...
Dan G. Ochoa's user avatar
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 ...
Joshua Chan's user avatar
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\...
abbyejohnson's user avatar
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? ...
Mariah.H's user avatar
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, ...
coral's user avatar
  • 81
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 ...
loosebroose's user avatar
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 ...
nrg's user avatar
  • 11
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 ...
Ashmitha Nihar's user avatar
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 ...
Andrea Piedrahita's user avatar
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. ...
Shraddha Sharma's user avatar
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 ...
Lee Ann's user avatar
  • 21
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 ...
Ahmad Raji's user avatar
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....
Eifa's user avatar
  • 1
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 ...
jcholly's user avatar
  • 166
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','...
GIS_developer's user avatar

15 30 50 per page
1
2 3 4 5
21