Show Navigation | Hide Navigation
You are here:
Geoprocessing > Automating your work with scripts > Scripting object: Properties and Methods > Properties and Methods

Extent properties

Release 9.3
Last modified January 19, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Properties and Methods"


Related Topics

Note: This topic was updated for 9.3.1.

NOTE: Supported only when the geoprocessor is instantiated using the arcgisscripting module with a version of 9.3. Extent will otherwise return a space delimited string (XMin YMin XMax YMax).
Learn more about creating the geoprocessor object




Property
The value of this property can only be read. It can't be set. XMin
The value of this property can only be read. It can't be set. YMin
The value of this property can only be read. It can't be set. XMax
The value of this property can only be read. It can't be set. YMax
The value of this property can only be read. It can't be set. MMin
The value of this property can only be read. It can't be set. MMax
The value of this property can only be read. It can't be set. ZMin
The value of this property can only be read. It can't be set. ZMax
The value of this property can only be read. It can't be set. Width
The value of this property can only be read. It can't be set. Height
The value of this property can only be read. It can't be set. Depth
The value of this property can only be read. It can't be set. LowerLeft: Point Object
The value of this property can only be read. It can't be set. LowerRight: Point Object
The value of this property can only be read. It can't be set. UpperLeft: Point Object
The value of this property can only be read. It can't be set. UpperRight: Point Object


Examples



import arcgisscripting
gp = arcgisscripting.create(9.3)

# Open a search cursor on a feature class (polygon or polyline).
#
rows = gp.searchcursor(r"C:\hydro\river_lines.shp")

# Get the first row of the feature class.
#
row = rows.next()

# Get the shape field.
#
shape = row.shape

# Get the extent object.
#
extent = shape.extent

# Print out properties of the extent object.
#
print "XMin: %f" % (extent.xmin)
print "YMin: %f" % (extent.ymin)print "XMax: %f" % (extent.xmax)
print "YMax: %f" % (extent.ymax)

if extent.mmin:
    print "MMin: %f" % (extent.mmin)
    print "MMax: %f" % (extent.mmax)

if extent.zmin:
    print "ZMin: %f" % (extent.zmin)
    print "ZMax: %f" % (extent.zmax)

print "Width: %f" % (extent.width)
print "Height: %f" % (extent.height)

if extent.depth:
    print "Depth: %f" % (extent.depth)

# LowerLeft, LowerRight, UpperLeft, and UpperRight properties return
#   point objects.  Print out the x and y properties for each point object.
#
ll = extent.lowerleft
print "LowerLeft (x;y): %f;%f" % (ll.x, ll.y)

lr = extent.lowerright
print "LowerRight (x;y): %f;%f" % (lr.x, lr.y)

ul = extent.upperleft
print "UpperLeft (x;y): %f;%f" % (ul.x, ul.y)

ur = extent.upperright
print "UpperRight (x;y): %f;%f" % (ur.x, ur.y)


Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.