Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question

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.

share|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 "[")

share|improve this answer
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: However, ArcGIS SERVER will no longer support VBScript after 10.0. – RyanDalton 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).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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