float(!SHAPE.CENTROID!.split()[0])
Hello all! The company I am currently working for has decided to migrate from ArcGIS 9.3 to 10.0 recently and we are having difficulty using a few of our Arc 9.3 models that utilize the Calculate Field tool. They were written in VBA and I need to get them to work using VBScript. The following bit of code is intended to calculate the x coordinate of the centre of a harvesting block and put it in a field.Field Name: xcoordExpression: dblXExpression Type: VBCode Block: Dim dblX as Double Dim pArea as IArea Set pArea = [Shape] dblX = pArea.Centroid.X
Dim dblX as Double Dim pArea as IArea Set pArea = [Shape] dblX = pArea.Centroid.X
Use Python if you want access to geoprocessing functionality, including feature geometry....If you have VBA code from past releases that use ArcObjects, you will need to modify your calculations to work in 10.0.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.