Hello ArcGIS Forum Users,I have been able to use Python to copy a polyline dataset and add four fields (FROM_X, TO_X, FROM_Y, TO_Y) but am having trouble with populating the fields with the appropriate information. I would like to use Python to populate them in the following manner:FROM_X = X Coordinate of Line StartTO_X = X Coordinate of Line EndFROM_Y = Y Coordinate of Line StartTO_Y = Y Coordinate of Line EndI know it can be done manually by opening the datasets attribute table, right clicking on a field, selecting Calculate Geometry and then the appropriate Property but I would like to have a Python script be able to do this so it can be embedded in a SAS script. The COPY and ADD FIELD Python script works in SAS so I am hoping the CALCULATE FIELD will as well.I tried using the Data Management - Fields - Calculate Field and its Python option for FROM_X using:arcpy.CalculateField_management(dataset, fieldname, !FROM_X!.firstpoint.x,"PYTHON_9.3","")
The script runs without errors but does nothing to my dataset. I suspect I am missing a step but do not know what to do next.Any input you may provide is greatly appreciated.Thank you.Greg Parent