Remove specific layer from ArcPro 2.5 with Python

225
1
05-18-2020 10:23 AM
PublicadorPublicador
New Contributor

Hi, 

How can I remove a layer using python in arcpro?

Thank´s

Tags (1)
0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

From here....

Map—ArcPy | Documentation 

removeLayer (remove_layer)

Provides the ability to remove a layer from a map in a project.

Now from the code section in that topic,

  • substitute your project name,
  • same for the listMaps option
  • ditto for listLayers and finally
  • replace insertLayer with removeLayer 
  • then save the project

... sort of retired...