I am trying to determine whether my shape file that I pass is in M-aware (has M value). I keep getting an error
Attribute Error: 'Polyline' object has no attribute 'hasM'
Not sure what I am doing wrong. Any help would be greatly appreciated.
import arcpy def ValidInputGeometry(feat): is_valid_poly_line = False is_m_enabled = False error_msg = None if feat.type == "polyline": if is_m_enabled == feat.hasM: is_valid_poly_line = True else: error_msg = "The input geometry is not M-Aware" else: error_message = "The input geometry is not a polyline" return (is_valid_poly_line, error_msg) station_interval = 10000 in_polyline_m_layer = "C:/Users/Algorithm/LWOB_levee.shp" target_feature_rows = arcpy.SearchCursor(in_polyline_m_layer, "FID = 0", "", "", "") layer_description = arcpy.Describe(in_polyline_m_layer) shape_field = layer_description.ShapeFieldName for row in target_feature_rows: feat = row.getValue(shape_field) (Valid, Msg) = ValidInputGeometry(feat)