Got an easy one, that's got me stuck. I'm moving some models that were created in 9.3.1 to work in 10.
Part of the model is calculating the X coordinate of a polygon to a specified field.
The code that works (in 9.3.1) is
Dim Output As Double Dim pArea As IArea Set pArea = [Shape] Output = pArea.Centroid.X Expression = output
It doesnt work in 10 as i get the following error.
General error executing calculator. ERROR 999999: Error executing function. Expected end of statement Failed to execute (Calculate Field X_COORD).
I've tried the following using the python parser
def calc(shape,x): x = "shape.CENTROID!.split() return x calc(!SHAPE!, !X_COORD! )
But that gives an error - invalid syntax on line 2.
Any pointers? Thanks