<?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: ArcGIS Pro is not displaying a point that was programmatically added. in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1176183#M8168</link>
    <description>&lt;P&gt;Yes,&lt;/P&gt;&lt;P&gt;We are doing something very similar when setting the Shape attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coordinate3D pt;&lt;BR /&gt;pt.X = BitConverter.ToDouble(data, offset);&lt;BR /&gt;offset += sizeof(double);&lt;BR /&gt;pt.Y = BitConverter.ToDouble(data, offset);&lt;BR /&gt;offset += sizeof(double);&lt;BR /&gt;pt.Z = BitConverter.ToDouble(data, offset);&lt;/P&gt;&lt;P&gt;MapPointBuilder builder = new MapPointBuilder(pt, _sfa_util.GeoCS);&lt;BR /&gt;builder.HasZ = layer.HasZ;&lt;BR /&gt;builder.HasM = layer.HasM;&lt;/P&gt;&lt;P&gt;if (builder.HasM) {&lt;BR /&gt;builder.M = 0.0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;MapPoint geom = builder.ToGeometry() as MapPoint;&lt;BR /&gt;Coordinate3D projected_geom;&lt;/P&gt;&lt;P&gt;if (layer.SpatialRef.HasVcs) {&lt;BR /&gt;ProjectionTransformation proj_trans =&lt;BR /&gt;ProjectionTransformation.CreateWithVertical(_sfa_util.GeoCS, layer.SpatialRef);&lt;/P&gt;&lt;P&gt;projected_geom = (Coordinate3D)GeometryEngine.Instance.ProjectEx(geom, proj_trans);&lt;/P&gt;&lt;P&gt;} else {&lt;BR /&gt;projected_geom = (Coordinate3D)GeometryEngine.Instance.Project(geom, layer.SpatialRef);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;layer.map_point = geom;&lt;/P&gt;&lt;P&gt;attributes[layer.GeomField] = projected_geom;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It returns true and the exact same point is sent into ArcGIS Desktop, via another plugin, which works fine.&lt;/P&gt;&lt;P&gt;The same code is called for lines and polygons and they draw fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks anyways.&lt;/P&gt;</description>
    <pubDate>Sat, 21 May 2022 12:44:04 GMT</pubDate>
    <dc:creator>BillSmith</dc:creator>
    <dc:date>2022-05-21T12:44:04Z</dc:date>
    <item>
      <title>ArcGIS Pro is not displaying a point that was programmatically added.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1174943#M8149</link>
      <description>&lt;P&gt;This code is being executed and it returns true.&lt;/P&gt;&lt;P&gt;The new point feature says it has been added and you can see it in the attribute table.&lt;/P&gt;&lt;P&gt;Yet it won't draw or jump to the point like any others that were added in ArcGIS Pro directory.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Bill&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code snippet.&lt;/P&gt;&lt;P&gt;var edit_op = new EditOperation();&lt;/P&gt;&lt;P&gt;edit_op.Name = $"Create {layer.Name}";&lt;BR /&gt;edit_op.SelectNewFeatures = true;&lt;BR /&gt;edit_op.Create(layer.FeatureLayer, attributes);&lt;BR /&gt;bool result = edit_op.Execute();&lt;/P&gt;&lt;P&gt;SfaLogger.Log("Return from insert operation is: " + result.ToString());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW:&lt;/P&gt;&lt;P&gt;I have something very similar in ArcGIS Desktop using ArcObject code and the same point inserts and&lt;/P&gt;&lt;P&gt;is drawn fine in ArcMap.&amp;nbsp; The point coming into the API from our software is identical in both cases.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 16:04:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1174943#M8149</guid>
      <dc:creator>BillSmith</dc:creator>
      <dc:date>2022-05-18T16:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro is not displaying a point that was programmatically added.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1175544#M8152</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Have you tried Esri ArcGIS Pro sample&amp;nbsp;&lt;A title="AddFeatureTest" href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Editing/AddFeatureTest" target="_self"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Editing/AddFeatureTest&lt;/A&gt;&amp;nbsp;?&lt;/P&gt;&lt;P&gt;I think issue is with "attributes" variable setting or points spatial reference. If your points don't have spatial reference then they could be somewhere on map.&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 14:02:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1175544#M8152</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-05-19T14:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro is not displaying a point that was programmatically added.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1176183#M8168</link>
      <description>&lt;P&gt;Yes,&lt;/P&gt;&lt;P&gt;We are doing something very similar when setting the Shape attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coordinate3D pt;&lt;BR /&gt;pt.X = BitConverter.ToDouble(data, offset);&lt;BR /&gt;offset += sizeof(double);&lt;BR /&gt;pt.Y = BitConverter.ToDouble(data, offset);&lt;BR /&gt;offset += sizeof(double);&lt;BR /&gt;pt.Z = BitConverter.ToDouble(data, offset);&lt;/P&gt;&lt;P&gt;MapPointBuilder builder = new MapPointBuilder(pt, _sfa_util.GeoCS);&lt;BR /&gt;builder.HasZ = layer.HasZ;&lt;BR /&gt;builder.HasM = layer.HasM;&lt;/P&gt;&lt;P&gt;if (builder.HasM) {&lt;BR /&gt;builder.M = 0.0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;MapPoint geom = builder.ToGeometry() as MapPoint;&lt;BR /&gt;Coordinate3D projected_geom;&lt;/P&gt;&lt;P&gt;if (layer.SpatialRef.HasVcs) {&lt;BR /&gt;ProjectionTransformation proj_trans =&lt;BR /&gt;ProjectionTransformation.CreateWithVertical(_sfa_util.GeoCS, layer.SpatialRef);&lt;/P&gt;&lt;P&gt;projected_geom = (Coordinate3D)GeometryEngine.Instance.ProjectEx(geom, proj_trans);&lt;/P&gt;&lt;P&gt;} else {&lt;BR /&gt;projected_geom = (Coordinate3D)GeometryEngine.Instance.Project(geom, layer.SpatialRef);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;layer.map_point = geom;&lt;/P&gt;&lt;P&gt;attributes[layer.GeomField] = projected_geom;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It returns true and the exact same point is sent into ArcGIS Desktop, via another plugin, which works fine.&lt;/P&gt;&lt;P&gt;The same code is called for lines and polygons and they draw fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks anyways.&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 12:44:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1176183#M8168</guid>
      <dc:creator>BillSmith</dc:creator>
      <dc:date>2022-05-21T12:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro is not displaying a point that was programmatically added.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1176293#M8169</link>
      <description>&lt;P&gt;Hi Bill,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking at your code above - you are actually assigning a Coordinate3D to the geometry field in your attributes collection.&amp;nbsp; You actually need to be assigning a MapPoint.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;A Coordinate3D is only a lightweight structure and is not the same as a MapPoint.&amp;nbsp; The point feature class expects a geometry of type MapPoint.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can fix this by not casting the result of the GeometryEngine ProjectEx or Project routines to Coordinate3D but casting the result to a MapPoint.&amp;nbsp; &amp;nbsp;This should fix your problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 07:04:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1176293#M8169</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2022-05-23T07:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro is not displaying a point that was programmatically added.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1176733#M8179</link>
      <description>&lt;P&gt;That s a great catch.&amp;nbsp; Thank you.&amp;nbsp; I think I have seen this problem before with the projection engine casting to the wrong types but didn't catch it.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 07:07:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-is-not-displaying-a-point-that-was/m-p/1176733#M8179</guid>
      <dc:creator>BillSmith</dc:creator>
      <dc:date>2022-05-24T07:07:49Z</dc:date>
    </item>
  </channel>
</rss>

