Using ArcGIS Pro v3.5.5, and trying to calculate planar feet for a line feature class:
arcpy.management.CalculateGeometryAttributes(in_features=line_fc, geometry_property=[["Length", "LENGTH"]], length_unit="FEET_INT")
However, I'm getting an error that says "LENGTH" is no longer an accepted input value, and that I can only use "LENGTH_GEODESIC" or "LENGTH_3D". It is still listed in ESRI's documentation as an option though, and is also an option when calculating geometry via ArcGIS Pro GUI.
Here is the error:
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000800: The value is not a member of LENGTH_GEODESIC | LENGTH_3D | LINE_BEARING | PART_COUNT | POINT_COUNT | CURVE_COUNT | LINE_START_X | LINE_START_Y | LINE_START_Z | LINE_END_X | LINE_END_Y | LINE_END_Z | CENTROID_X | CENTROID_Y | CENTROID_Z | INSIDE_X | INSIDE_Y | INSIDE_Z | EXTENT_MIN_X | EXTENT_MIN_Y | EXTENT_MIN_Z | EXTENT_MAX_X | EXTENT_MAX_Y | EXTENT_MAX_Z.
Failed to execute (CalculateGeometryAttributes).
Wondering if this is a bug, or if it's removal from arcpy() is intentional? For what it's worth, that line of code worked for me in ArcGIS Pro v3.3.2, prior to upgrading to v3.5.5. For now, I've coded up a workaround using !shape.length@feet!
It looks to me that it is intentional.
You can try below code as a workaround.
arcpy.management.CalculateField(line_fc, "Length_Feet", "!shape.length@feet!", "PYTHON3")
Calculate Field (Data Management)—ArcGIS Pro | Documentation
is "Length" and existing field name in the geodatabase? (checking for a reserved word trigger),
if it isn't try using a different name.
There are no publicly facing bugs bugs on the Support web site for this version of Pro
@DanPatterson , I'm getting the same error for other feature classes in separate GDBs where "Length" is not being used as a field name.
@VenkataKondepati, after reading the CalculateField documentation more thoroughly, I noticed this syntax can be used: !shape!.getLength('PLANAR', 'FeetInt'), which is helpful because it allows you to control both the measurement method (Geodesic vs Planar) and the output unit.
Yes. This should work as well.