Centroid Coordinate Extraction from shp layer

Discussion created by isxhy850815 on Nov 16, 2011
Dear Guy,

I dont know where I should have in this problem. So I pasted it here as a part of spatial analyst.

I have got a layers with many polygon. I want to calcuate the centroid coordinates in my field.

Currently, I use Python script and it works like

Area: !shape.area!
Boundaries: !shape.length!

But how could I got centroid coordinates in the field. I tried to use

!shape.centroid.split()[0]!, !shape.centroid!.split()[0], etc, but it doesnot work.

Any suggestions? Many thanks.