I used to run this length calc on my data in ArcGIS 8 and 9, and now it don't work in ArcGIS10. Can you tell me what I have done wrong?

Dim dbllength as double
Dim pcurve as icurve
Set Pcurve = [shape]
Dbllength = Pcurve.Length
Length = dbllength

it is much easier now in 10.
Right click on the length field and select calculate geometry.
you can select the pcs of the data or the document,
then select the units.

| improve this answer | |

do you mean inside the field calculator?

in this case I suggest you to use python because starting from 10.0 it's the "official" language supported in ArcGIS

10.0 is the last ArcGIS version that uses VBscript, staring from 10.1 it will be deprecated and unsupported

with Python in field calculator you have to use !Shape.length! or !Shape.area! (Python "!" replace VBScript "[")

| improve this answer | |
  • 1
    Actually, Esri documentation actually states that 10.0 will be the last DESKTOP version to support VBA (as opposed to VBScript, will still be supported). "ArcGIS 10.0 is the last release with full Microsoft Visual Basic for Applications (VBA) support. With ArcGIS 10.1 we will no longer support VBA development." See page 2 under ArcGIS Desktop 10.0: resources.esri.nl/downloads/ArcGIS_10_Deprecation_Plan.pdf. However, ArcGIS SERVER will no longer support VBScript after 10.0. – RyanKDalton Nov 14 '11 at 21:35
  • You're right but as far as I know VbScript is based on vba support and in turn I'm quite confident it will be discontinued from 10.1 – Roberto Messora Nov 15 '11 at 8:25

Calculate Field with geometry in 10.x REQUIRES that you use Python. VBScript access to geometry is no longer supported.

Python is the recommended scripting language for ArcGIS. Use Python if you want access to geoprocessing functionality, including feature geometry.

Use VBScript if you have VBA or VBScript experience and are comfortable with the scripting syntax. Saved .cal files from previous versions of ArcGIS may work or require minimal modifications. If you have VBA (I think they mean VBScript) code from past releases that use ArcObjects, you will need to modify your calculations to work in 10.0.


I think the suggestion to use VBScript is bad advice... VBScript expressions cause the Calculate Field tool to fail in 64-bit environments (Background geoprocessing, ArcGIS Server, standalone python scripts running in 64bit).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.