0

I would like to know how to set up the Output extent on ArcMAP using Python.

I have a loop to Create Thiessen Polygons, but I didn't mange to change my output extent the size I want.

arcpy.Extent(293490,5898230,316430,5930230)

for i in range(3,51,1):
    arcpy.CreateThiessenPolygons_analysis("AVF%i" % i,"AVF%iVoronoi" % i,"ONLY_FID")

Thanks for your help

user1166251
  • 115
  • 1
  • 4
  • 17

1 Answers1

1

The map extent can be set through the DataFrame object. See this ESRI help page This appears to set the current extent of the data frame. I don't know if you can set the full or maximum extent of the frame.

#arcpy.Extent(293490,5898230,316430,5930230)

#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument("CURRENT")

df = arcpy.mapping.ListDataFrames(mxd)[0]
newExtent = df.extent
newExtent.XMin, newExtent.YMin = 293490,5898230
newExtent.XMax, newExtent.YMax = 316430,5930230
df.extent = newExtent
tharen
  • 1,262
  • 10
  • 22
  • oh ok, it is completely different from arcpy.Extent though. Do you know the role of arcpy.Extent? – user1166251 Jan 25 '12 at 02:34
  • arcpy.Extent is the Python class representing a generic extent object. df.extent is and instance of arcpy.Extent, `isinstance(df.extent,arcpy.Extent)` will return True in the example above. – tharen Jan 26 '12 at 01:24