AnsweredAssumed Answered

zoomToSelectedFeatures () scale differences 'CURRENT' and 'mxd_path'

Question asked by mshukun1 on Nov 20, 2015
Latest reply on Nov 20, 2015 by FGibson-esristaff

I encountered a problem that zoomToSelectedFeatures() works differently in ArcMap and using ArcPy explicitly in another Python editor having the exact same dataset (one point layer in the data frame) in the MXD file.  I tested the same code except MXD path ('CURRENT' in ArcMap) and got different scales.  1:2,167 in ArcMap and 1: 4,053 using ArcPy in another Python editor.  I couldn't figure out what was causing the problem.  I would very much appreciate any assistance.

 

mxd = arcpy.mapping.MapDocument(mxd_path)
df = arcpy.mapping.ListDataFrames(mxd, 'Layers')[0]
df.zoomToSelectedFeatures()
print df.scale

 

Thank you.

Outcomes