shrug-l: Zoom map to the extent of a layer in Arcpy.mp

Jeff Reed fsu1jreed at gmail.com
Fri Jun 2 13:45:45 EDT 2017


Yes there is.

There's the getSelectedExtent method for a Layer
<http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Layer/00s300000008000000/>
:

   - getExtent ({symbolized_extent}) - Returns a layer's geometric or
   symbolized extent
   - getSelectedExtent ({symbolized_extent}) - Returns a layer's geometric
   or symbolized extent for selected features

A getSelectedExtent method
<http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/>
Dataframe
<http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/>
:

   - panToExtent (extent) - Pans and centers the data frame extent using a
   new Extent object without changing the data frame's scale
   - zoomToSelectedFeatures () - Changes the data frame extent to match the
   extent of the currently selected features for all layers in a data frame

Plus you can try these:

   - df.zoomToSelectedFeatures() - will zoom to the extents of the data
   frame to all selected features in the map frame
   - lyr.getSelectedExtent() - will zoom to to a selection set for a
   specific layer


On Fri, Jun 2, 2017 at 9:48 AM, Pollock, William H. (Bill) <
William.H.Pollock at dep.state.fl.us> wrote:

> Howdy SHRUG –
>
>
>
> Anyone find a way to “zoom Map to the extent of a layer in Arcpy.mp” ?
>
>
>
> There are many scenarios where this basic function, zooming to a layer or
> a selection, would be used, right ?
>
>
>
> *Zoom map to the extent of a layer in Arcpy.mp *(May 02, 2017)
>
> https://geonet.esri.com/thread/194310-zoom-map-to-an-
> layer-in-arcpymp-arcgis-pro-project
>
>
>
> *Choosing and zooming to features using SQL query in ArcPy with ArcGIS
> Pro? *(Dec 14, 2015)
>
> https://gis.stackexchange.com/questions/173687/choosing-and-
> zooming-to-features-using-sql-query-in-arcpy-with-arcgis-pro
>
>
>
> Thank you and cheers,
>
> + bill
>
>
>
> William Pollock, GISP
>
> Kyra Solutions, Inc.
>
> FL Department of Environmental Protection
>
> 850.245.2722 ext. 4722 <(850)%20245-2722>
>
>
>
> _______________________________________________
> SHRUG-L mailing list
> SHRUG-L at lists.dep.state.fl.us
> http://lists.dep.state.fl.us/mailman/listinfo/shrug-l
>
>


-- 
Jeff Reed
GIS Analyst/ECUA
Adjunct Professor/Delta State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dep.state.fl.us/pipermail/shrug-l/attachments/20170602/14d902fe/attachment.html>


More information about the SHRUG-L mailing list