Is it possible to label a feature in ArcMap using geometry values?
In this instance I want to label features (polylines) with the Live Z value of the last vertex obtained from the Shape.
However when I try something simple like the XMin of the extent of the shape:
It returns an error:
Is it possible to use the features' geometry to formulate a label? I do not want to calculate values from the geometry into a field and then label that field unless I absolutely have to:
Ideally the label should be live, changing as the feature is modified.
Based on the answer by Felix:
def FindLabel ( [OBJECTID] ): mxd = arcpy.mapping.MapDocument("CURRENT") layers=arcpy.mapping.ListLayers(mxd, "WatrcrsL") lr=layers with arcpy.da.SearchCursor(lr, 'Shape@','OBJECTID = '+str( [OBJECTID] )) as cursor: for row in cursor: a=row.lastPoint.Z return a
Will label the features with the last points' Z value live!