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 need to calculate the max M value for a line feature using Python in ArcGIS 10 Field Calculator but I cannot figure it out. In 9.3 I used the follow VBA expression…

**Pre-Logic VBA Script Code:**
dim m as imcollection
set m = [shape]
dim d as double 
d = m.mmax

**EndStation =:**
share|improve this question
You are also able to use VBA in ArcGIS 10 also, if you want too. You just tick the box VBA, instead of Python when in the field calculator. – djq Jun 28 '11 at 14:27
With the python parser selected !Shape.extent.XMax! produces the maximum X of a feature extent perhaps !Shape.MMax! might work. sorry I don't have an M-enabled file to check on, but it is worth a shot. – Dan Patterson Jun 28 '11 at 14:29
I have tried using my old VBA code but it won't work in 10. – user3123 Jun 28 '11 at 15:05
If I put !Shape.MMax! in the codeblock what would I put EndStation equal to? – user3123 Jun 28 '11 at 15:12
Since I can't try it, check the Python parser, don't toggle on the code block, simply select the field, launch the field calculator and paste in the code snippet. It isn't a function (def) just a field calculator expression, like !shape.area! will calculate area for polygons. – Dan Patterson Jun 28 '11 at 15:50

Use !shape.extent.mmax! to return the max measures for routes.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

use field calc to return the MAX M measures:


use field calc to return the Min M measures:


you can then calculate the M-length of the line using subtraction.

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.