5

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 =:**
d
7
  • 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. Commented Jun 28, 2011 at 14:27
  • 2
    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. Commented Jun 28, 2011 at 14:29
  • I have tried using my old VBA code but it won't work in 10. Commented Jun 28, 2011 at 15:05
  • If I put !Shape.MMax! in the codeblock what would I put EndStation equal to? Commented Jun 28, 2011 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. Commented Jun 28, 2011 at 15:50

2 Answers 2

4

use field calc to return the MAX M measures:

!Shape.extent.MMax!

use field calc to return the Min M measures:

!Shape.extent.MMin!

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

3

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.