Select to view content in your preferred language

[SOLVED] Zoom to Layer (Not Zoom to Selected Feature)

688
2
05-14-2012 02:08 PM
JoelMadero
Emerging Contributor
Is there a way to zoom to layer instead of zoom to selected feature. The zoom to selected feature works for me but it's so much slower than just setting a definition query and then zooming to layer (same as right click on layer, zoom to layer). Thanks in advance
Tags (2)
0 Kudos
2 Replies
MathewCoyle
Honored Contributor
I use
dataframe.extent = lyr.getExtent(True)
i don't know how much faster it really is though.
0 Kudos
JoelMadero
Emerging Contributor
I use
dataframe.extent = lyr.getExtent(True)
i don't know how much faster it really is though.


That did it, so much faster actually. It took out two searches from my code which makes the script run at least 50% faster. Thanks !
0 Kudos