Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

Thanks,

Matt

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
1  
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

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

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.