Accessing "Clip Layers" map properties via Python

138
3
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 Honored 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

3 Replies
DanPatterson
MVP Honored 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

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