Accessing "Clip Layers" map properties via Python

1255
7
Jump to solution
06-21-2021 12:41 PM
Labels (1)
DavidChan2
New Contributor II

Hi all,

In Map Properties, there's the option to Clip Layer, where you can select between No clipping, Clip to the outline of features, and Clip to a custom extent

DavidChan2_0-1624304085617.png

Is there a way to set this via Python? I'm currently running ArcGIS Pro v2.7.3.

 

Thanks!

 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

The help Clip layers in a map—ArcGIS Pro | Documentation

shows no python access, so you will have to use one of the geoprocessing tools that does the clipping you need.

Clip (Analysis)—ArcGIS Pro | Documentation  to keep inside

Erase (Analysis)—ArcGIS Pro | Documentation to keep outside

or one or more of the other overlay tools

An overview of the Overlay toolset—ArcGIS Pro | Documentation

Can you narrow down what you use the most often?  There is a python section for each tool's dialog in their respective help

 


... sort of retired...

View solution in original post

7 Replies
DanPatterson
MVP Esteemed Contributor

The help Clip layers in a map—ArcGIS Pro | Documentation

shows no python access, so you will have to use one of the geoprocessing tools that does the clipping you need.

Clip (Analysis)—ArcGIS Pro | Documentation  to keep inside

Erase (Analysis)—ArcGIS Pro | Documentation to keep outside

or one or more of the other overlay tools

An overview of the Overlay toolset—ArcGIS Pro | Documentation

Can you narrow down what you use the most often?  There is a python section for each tool's dialog in their respective help

 


... sort of retired...
DavidChan2
New Contributor II

I figured that might be the case, but I appreciate the confirmation.

I'm using this functionality as a component of a template designed to generate a Map Series with several maps as part of the layout that I'm trying to have the Clip layers functionality impact. The map series will have several hundred pages, so clipping rasters via GP tools wouldn't be ideal.

Resetting the map properties manually to clip appropriately each time the template is used shouldn't be too bad. Just trying to simplify the process for different end users - they'll just have to deal with a few extra clicks 😉

0 Kudos
JeffBarrette
Esri Regular Contributor

David, I looked into Python CIM Access but because the clipping layer uses binary reference for performance purposes, it can't be done.  It did stimulate a conversation that we should add this into our managed API.  Thanks for bringing it up.

Jeff - Layout and arcpy.mp teams

0 Kudos
JeffBarrette
Esri Regular Contributor

We have plans to address this in Pro 3.2. so that it can be done using arcpy.mp.

Jeff - Layout and arcpy.mp teams

DavidChan2
New Contributor II
That's great news. Thank you for the update
KITEfejlesztes
New Contributor

Hi Jeff,

Is it already possible to do this with python in PRO 3.2?

0 Kudos
JeffBarrette
Esri Regular Contributor

Yes, this was added at Pro 3.2. 

See: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm

Jeff - Layout arcpy.mp teams

0 Kudos