<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Attribute rule works in Pro 2.9.2, but not in Pro 2.6.8 in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1159913#M374</link>
    <description>&lt;P&gt;I have a calculation attribute rule that works in Pro 2.9.2 (in a 2.9.2 FGDB). It updates the M-values of the polyline geometry:&lt;/P&gt;&lt;PRE&gt;function pythagoras(x1, y1, x2, y2) {
    return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}

&lt;FONT color="#999999"&gt;var geom = Dictionary(Text(Geometry($feature)));&lt;/FONT&gt;
var paths = geom['paths'];
var oldX = paths[0][0][0];
var oldY = paths[0][0][1];
var line_length = 0;

for (var path_idx in paths) {
    for (var point_idx in paths[path_idx]) {
        var newX = paths[path_idx][point_idx][0];
        var newY = paths[path_idx][point_idx][1];
        if (point_idx != 0) {
            line_length += pythagoras(oldX, oldY, newX, newY);
        }
        paths[path_idx][point_idx][-1] = line_length;
        oldX = newX;
        oldY = newY;
    }
}
&lt;FONT color="#999999"&gt;return Polyline(geom);&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;However, if I create that attribute rule in Pro 2.6.8 (in a separate 2.6.8 FGDB), it doesn't work as expected. It runs without errors, and it even densifies true curves (which tells me that the code&amp;nbsp;&lt;EM&gt;is&lt;/EM&gt; running), but it doesn't update the M-values of the vertices properly (it sets the M-values to Nan).&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;Is there something in that script that is not supported in older versions of ArcGIS Pro?&lt;/P&gt;&lt;P&gt;I believe the&amp;nbsp;Dictionary(), Text(), and Geometry() functions are working ok (since the script successfully returns a densified geometry). So I think it must be something else. Unfortunately, I can't upgrade Pro any further right now, since our version of license manager doesn't support later versions of Pro.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Apr 2022 15:17:42 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2022-04-25T15:17:42Z</dc:date>
    <item>
      <title>Attribute rule works in Pro 2.9.2, but not in Pro 2.6.8</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1159913#M374</link>
      <description>&lt;P&gt;I have a calculation attribute rule that works in Pro 2.9.2 (in a 2.9.2 FGDB). It updates the M-values of the polyline geometry:&lt;/P&gt;&lt;PRE&gt;function pythagoras(x1, y1, x2, y2) {
    return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}

&lt;FONT color="#999999"&gt;var geom = Dictionary(Text(Geometry($feature)));&lt;/FONT&gt;
var paths = geom['paths'];
var oldX = paths[0][0][0];
var oldY = paths[0][0][1];
var line_length = 0;

for (var path_idx in paths) {
    for (var point_idx in paths[path_idx]) {
        var newX = paths[path_idx][point_idx][0];
        var newY = paths[path_idx][point_idx][1];
        if (point_idx != 0) {
            line_length += pythagoras(oldX, oldY, newX, newY);
        }
        paths[path_idx][point_idx][-1] = line_length;
        oldX = newX;
        oldY = newY;
    }
}
&lt;FONT color="#999999"&gt;return Polyline(geom);&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;However, if I create that attribute rule in Pro 2.6.8 (in a separate 2.6.8 FGDB), it doesn't work as expected. It runs without errors, and it even densifies true curves (which tells me that the code&amp;nbsp;&lt;EM&gt;is&lt;/EM&gt; running), but it doesn't update the M-values of the vertices properly (it sets the M-values to Nan).&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;Is there something in that script that is not supported in older versions of ArcGIS Pro?&lt;/P&gt;&lt;P&gt;I believe the&amp;nbsp;Dictionary(), Text(), and Geometry() functions are working ok (since the script successfully returns a densified geometry). So I think it must be something else. Unfortunately, I can't upgrade Pro any further right now, since our version of license manager doesn't support later versions of Pro.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 15:17:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1159913#M374</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-04-25T15:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule works in Pro 2.9.2, but not in Pro 2.6.8</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1160475#M377</link>
      <description>&lt;P&gt;The following test script works in Pro 2.6.8. It adjusts the Y-coordinates, instead of the M-coordinates.&lt;/P&gt;&lt;PRE&gt;var geom = Dictionary(Text(Geometry($feature)));
var paths = geom['paths'];

for (var path_idx in paths) {
    for (var point_idx in paths[path_idx]) {
        paths[path_idx][point_idx]&lt;FONT color="#339966"&gt;&lt;STRONG&gt;[1]&lt;/STRONG&gt;&lt;/FONT&gt; += 10
    }
}
return Polyline(geom);&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_3-1648850127841.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38011i43B5FACF03BC768C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_3-1648850127841.png" alt="Bud_3-1648850127841.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;However, if I change the script so that it updates the M-coordinates, instead of the Y-coordinates, then it doesn't work. I don't get any errors, but the M-values just get updated to &lt;FONT face="courier new,courier" color="#0000FF"&gt;Nan&lt;/FONT&gt;, which isn't what I want.&lt;/P&gt;&lt;PRE&gt;var geom = Dictionary(Text(Geometry($feature)));
var paths = geom['paths'];

for (var path_idx in paths) {
    for (var point_idx in paths[path_idx]) {
        paths[path_idx][point_idx]&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;[2]&lt;/STRONG&gt;&lt;/FONT&gt; += 10
    }
}
return Polyline(geom);&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_2-1648850083229.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38010iE61BD679EE58C328/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_2-1648850083229.png" alt="Bud_2-1648850083229.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That tells me that there is a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;bug in Pro 2.6.8.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;It isn't able to update the geometry's M-values correctly.&lt;/P&gt;&lt;P&gt;(And for what it's worth, I tried using the &lt;FONT face="courier new,courier" color="#0000FF"&gt;Geometry()&lt;/FONT&gt; function, instead of the &lt;FONT face="courier new,courier" color="#0000FF"&gt;Polyline()&lt;/FONT&gt; function, to return the value to the geometry. Similarly, that worked for the Y-coordinate, but not the M-coordinate).&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;I don't have that problem in Pro 2.9.2. The script can update M-values without issue:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1648850916692.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38014i119A17FD7BE0C846/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_1-1648850916692.png" alt="Bud_1-1648850916692.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So I think Esri must have fixed the problem in later versions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note: I came across an additional bug in 2.6.8 (a problem with true curves):&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/get-paths-of-polyline-with-true-curve-pro-2-6-8/m-p/1160383" target="_self"&gt;Get paths of polyline with true curve (Pro 2.6.8)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 14:37:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1160475#M377</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-04-03T14:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule works in Pro 2.9.2, but not in Pro 2.6.8</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1160614#M380</link>
      <description>&lt;P&gt;I would have to look it up, but I believe you could not modify the shape of a feature till 2.7 or 2.8 or since you were able to update Y, maybe it is something specific with M's.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 18:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1160614#M380</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2022-04-03T18:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule works in Pro 2.9.2, but not in Pro 2.6.8</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1173436#M419</link>
      <description>&lt;P&gt;Esri Canada support did some testing and found the issue was fixed in&amp;nbsp;&lt;SPAN&gt;ArcGIS Pro version 2.8.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case #&lt;/SPAN&gt;&lt;SPAN class=""&gt;03048202&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;Related:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;”&lt;SPAN&gt;Support for updating z-values (using the Move tool) was added in ArcGIS Pro 2.8.&amp;nbsp; If you haven’t updated yet, the steps described below should work to populate x,y,z attribute values when &lt;/SPAN&gt;&lt;EM&gt;creating&lt;/EM&gt;&lt;SPAN&gt; features and populate x,y attribute values when &lt;/SPAN&gt;&lt;EM&gt;moving&lt;/EM&gt;&lt;SPAN&gt; features.”&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/get-to-the-point-automatically-maintain-xyz-attribute-values-with-arcgis-pro-and-attribute-rules/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/get-to-the-point-automatically-maintain-xyz-attribute-values-with-arcgis-pro-and-attribute-rules/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 16:49:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-works-in-pro-2-9-2-but-not-in-pro-2/m-p/1173436#M419</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-05-12T16:49:41Z</dc:date>
    </item>
  </channel>
</rss>

