I have couples of immediate calculation rules that worked fine in ArcGIS Pro 2.9. After upgrading to 3.0.5 they don't work anymore. I even tried with ArcGIS Pro 3.1.1 with the same result. I reduced my rules to find the line that produced the error. Finally it seems to be a problem with m-aware feature classes.
For my tests I used Arc GIS Pro 3.0.5 with branch versioned data published to our Enterprise Portal (version 11.0.0). The feature classes are stored in a enterprise geodatabase (SQL).
I published two line feature classes. One with m-values and one without and added the same simple rule to them:
var feature_ = $feature;
var g = Geometry(feature_);
var t = Text(g)
var p = Polyline(t)
return p
This rule works fine for the feature class without m-values. If I try to modify a geometry with the m-aware polyline I get this error:
So it seems to bee a problem with the m-values in ArcGIS Pro 3.0.5 and newer.
Is there any workaround for this problem?
Solved! Go to Solution.
Does your feature class have m-values and not z-values?
The Text function incorrectly does not serialize hasM or hasZ when converting to text. This leaves the Polyline constructor in an ambiguous state when the paths have 3 values -- is it XYM or XYZ? Polyline defaults to XYZ which is probably why you seeing the entity type error. This is a known issue but here is a possible workaround for now:
var feature_ = $feature;
var g = Geometry(feature_);
var t = Text(g)
if (g.hasm) {
var d = Dictionary(t)
d["hasM"] = true
t = Text(d)
}
var p = Polyline(t)
return p
Does your feature class have m-values and not z-values?
The Text function incorrectly does not serialize hasM or hasZ when converting to text. This leaves the Polyline constructor in an ambiguous state when the paths have 3 values -- is it XYM or XYZ? Polyline defaults to XYZ which is probably why you seeing the entity type error. This is a known issue but here is a possible workaround for now:
var feature_ = $feature;
var g = Geometry(feature_);
var t = Text(g)
if (g.hasm) {
var d = Dictionary(t)
d["hasM"] = true
t = Text(d)
}
var p = Polyline(t)
return p
FYI - I also have an attribute rule that edits M-values here:
Arcade Code Review: Set polyline M-values to cumulative length of line
I haven't tested it in modern versions of Pro yet.
Related: GitHub - Create SetMValues
@TedHoward2
Regarding: "This is a known issue..."
Is there a bug number we can reference?