<?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 Re: Arcade Attribute Rule and WKT Values in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rule-and-wkt-values/m-p/1273852#M67420</link>
    <description>&lt;P&gt;To post formatted code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1677736512957.png" style="width: 546px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64138iBB0E7839D9513E0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1677736512957.png" alt="JohannesLindner_0-1677736512957.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1677736529803.png" style="width: 661px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64139i1EE5AE3E3AEE8247/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_1-1677736529803.png" alt="JohannesLindner_1-1677736529803.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can massively simplify your rule. It should work with a regular coordinate system. I didn't test it with a custom system, but maybe it works there, too.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var geom = Geometry($feature)
var z = IIf($feature.LIFECYCLESTATUS == 1, 1, 0)
return Point({"x": geom.x, "y": geom.y, "z": z, "spatialReference": geom.spatialReference})&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 30 Mar 2023 20:47:16 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-03-30T20:47:16Z</dc:date>
    <item>
      <title>Arcade Attribute Rule and WKT Values</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rule-and-wkt-values/m-p/1273670#M67405</link>
      <description>&lt;P&gt;I am writing an attribute rule against Utility Network Datasets to update the Z value on point features based on the features lifecycle status to be fired on update and create. I have several data sets where the first code snippet is working as they have “regular” coordinate systems with wkid values. I have one dataset that is a custom coordinate system I have been attempting to extract the wkt value from the point feature to construct the new geometry. However, the second code snippet where I am doing this is causing Pro to crash when opening the attributes pane of this data set.&lt;/P&gt;&lt;P&gt;Any thoughts on the different behavior between WKT and WKID references?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Side Note: if I disable the WKT attribute rule I do not see the crashing behavior.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WKID Z Value Update no issues: &lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;var geom_text = Text(Geometry($feature));&lt;/LI&gt;&lt;LI&gt;var geom = Dictionary(geom_text);&lt;/LI&gt;&lt;LI&gt;var xGeo = geom.x&lt;/LI&gt;&lt;LI&gt;var yGeo = geom.y&lt;/LI&gt;&lt;LI&gt;var spatialRef = geom.spatialReference&lt;/LI&gt;&lt;LI&gt;var wkidVal = spatialRef.wkid&lt;/LI&gt;&lt;LI&gt;var zGeoProposed = 1&lt;/LI&gt;&lt;LI&gt;var zGeoOther = 0&lt;/LI&gt;&lt;LI&gt;if($feature.LIFECYCLESTATUS != 1){&lt;/LI&gt;&lt;LI&gt;var newGeo = Point({"x": xGeo, "y": yGeo, "z":zGeoOther, spatialReference: {wkid: wkidVal}})&lt;/LI&gt;&lt;LI&gt;}&lt;/LI&gt;&lt;LI&gt;else{&lt;/LI&gt;&lt;LI&gt;var newGeo = Point({"x": xGeo, "y": yGeo, "z": zGeoProposed, spatialReference: {wkid: wkidVal}})&lt;/LI&gt;&lt;LI&gt;}&lt;/LI&gt;&lt;LI&gt;return newGeo;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WKT Z Value Update Crashes Pro&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;var geom_text = Text(Geometry($feature));&lt;/LI&gt;&lt;LI&gt;var geom = Dictionary(geom_text);&lt;/LI&gt;&lt;LI&gt;var xGeo = geom.x&lt;/LI&gt;&lt;LI&gt;var yGeo = geom.y&lt;/LI&gt;&lt;LI&gt;var spatialRef = geom.spatialReference&lt;/LI&gt;&lt;LI&gt;var wktVal = spatialRef.wkt&lt;/LI&gt;&lt;LI&gt;var wkidVal = null&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;var zGeoProposed = 1&lt;/LI&gt;&lt;LI&gt;var zGeoOther = 0&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;if($feature.LIFECYCLESTATUS != 1){&lt;/LI&gt;&lt;LI&gt;var newGeo = Point({"x": xGeo, "y": yGeo, "z":zGeoOther, spatialReference: {wkt: wktVal }})&lt;/LI&gt;&lt;LI&gt;}&lt;/LI&gt;&lt;LI&gt;else{&lt;/LI&gt;&lt;LI&gt;var newGeo = Point({"x": xGeo, "y": yGeo, "z": zGeoProposed, spatialReference: {wkt: wktVal }})&lt;/LI&gt;&lt;LI&gt;}&lt;/LI&gt;&lt;LI&gt;return newGeo;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 30 Mar 2023 19:27:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rule-and-wkt-values/m-p/1273670#M67405</guid>
      <dc:creator>Mary</dc:creator>
      <dc:date>2023-03-30T19:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Attribute Rule and WKT Values</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rule-and-wkt-values/m-p/1273852#M67420</link>
      <description>&lt;P&gt;To post formatted code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1677736512957.png" style="width: 546px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64138iBB0E7839D9513E0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1677736512957.png" alt="JohannesLindner_0-1677736512957.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1677736529803.png" style="width: 661px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64139i1EE5AE3E3AEE8247/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_1-1677736529803.png" alt="JohannesLindner_1-1677736529803.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can massively simplify your rule. It should work with a regular coordinate system. I didn't test it with a custom system, but maybe it works there, too.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var geom = Geometry($feature)
var z = IIf($feature.LIFECYCLESTATUS == 1, 1, 0)
return Point({"x": geom.x, "y": geom.y, "z": z, "spatialReference": geom.spatialReference})&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 20:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rule-and-wkt-values/m-p/1273852#M67420</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-03-30T20:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Attribute Rule and WKT Values</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rule-and-wkt-values/m-p/1274754#M67530</link>
      <description>&lt;P&gt;This works great, was not aware of IIF logic in arcade (still new to Arcade). Thanks again!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 16:10:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rule-and-wkt-values/m-p/1274754#M67530</guid>
      <dc:creator>Mary</dc:creator>
      <dc:date>2023-04-03T16:10:03Z</dc:date>
    </item>
  </channel>
</rss>

