desc = gp.Describe(input) extent = desc.Extent gp.AddMessage(extent)
Does anyone know why after fetching a describe object on a feature class and returning the Extent property, it returns the extent of the feature class in the current data frame coordinate system, not the extent of the data in its native coordinate system.
With data frame set to Web Mercator Aux Spheredesc = gp.Describe(input) extent = desc.Extent gp.AddMessage(extent)
returns
-13375837.6548833 5207681.31544134 -13372787.8830635 5209463.98928341
With data frame set to NAD 83 Albers it returns
587035.227167865 916043.393770546 589292.681698993 917353.957017839
Any thoughts?
Also, a workaround would be to check the data frame projection against the input in the ToolValidator code, any ideas if there's a way to grab data frame projection from the geoprocessor? I don't see any....
Thanks, Mike
I have just stumbled across the same thing (using ArcGIS 9.3.1). How can I get the extent of a feature class in its native coordinate system?
EDIT: just found a workaround:
gp.Describe(gp.Describe(layer).CatalogPath).Extent
This returns the extent of the layer in its native coordinate system by referencing the layer's source file on disk.
But perhaps there is a better way to do this?