hchapa89

Stand alone script for running zoom to selected Features

Discussion created by hchapa89 on Dec 6, 2013
Latest reply on Dec 9, 2013 by jbarrette-esristaff
I am trying to run a script outside of arc map I want the python script to zoom to selected features.
The following code works great inside of python but not outside of python.
mxd = arcpy.mapping.MapDocument("C:/Users/hchapa.LRGVDC911.000/Desktop/test.mxd")
dataframe = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
dataframe.zoomToSelectedFeatures()
arcpy.RefreshActiveView()

I want this code to run outside of arc map.
I had an idea using add ins but that still running inside of arc map.
Is there a way to launch a script outside and changing the view on a current open mxd file.

Outcomes