<?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: How to get Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112286#M10596</link>
    <description>&lt;P&gt;You can also see this sample as an example on how to get attributes for a feature. The example is in a 2D map, but the concept is not dependent on the view type (Map/SceneView).&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/wpf/sample-code/update-attributes-feature-service/" target="_self"&gt;https://developers.arcgis.com/net/wpf/sample-code/update-attributes-feature-service/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Conceptually, as Morten suggested above, you need to perform an identify operation from which you can get a list of GeoElements from your IdentifyResults, and once you get the GeoElement you want from the list, you can ask for it's attributes (geoElement.attribute). Something like this would give you the attribute value:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;string&lt;/SPAN&gt;&lt;SPAN&gt; currentAttributeValue = _selectedFeature.Attributes[AttributeFieldName].ToString();&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 00:28:14 GMT</pubDate>
    <dc:creator>KoushikHajra</dc:creator>
    <dc:date>2021-10-29T00:28:14Z</dc:date>
    <item>
      <title>How to get Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112030#M10592</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I created the sample WPF application using ArcGIS Runtime SDK for Dot Net.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I load the local slpk file with one building.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I cannot able to get that building attributes at runtime.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How to get that building information, when I click that building?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;like following figure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26391i4A87A85D40193DB0/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please give us advice&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 10:38:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112030#M10592</guid>
      <dc:creator>KarthikS</dc:creator>
      <dc:date>2021-10-28T10:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112181#M10594</link>
      <description>&lt;P&gt;You would use the Identify operation to find/inspect/select/ a feature. See this example:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/net/wpf/sample-code/scene-layer-selection/" target="_blank"&gt;https://developers.arcgis.com/net/wpf/sample-code/scene-layer-selection/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 16:39:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112181#M10594</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2021-10-28T16:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112286#M10596</link>
      <description>&lt;P&gt;You can also see this sample as an example on how to get attributes for a feature. The example is in a 2D map, but the concept is not dependent on the view type (Map/SceneView).&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/wpf/sample-code/update-attributes-feature-service/" target="_self"&gt;https://developers.arcgis.com/net/wpf/sample-code/update-attributes-feature-service/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Conceptually, as Morten suggested above, you need to perform an identify operation from which you can get a list of GeoElements from your IdentifyResults, and once you get the GeoElement you want from the list, you can ask for it's attributes (geoElement.attribute). Something like this would give you the attribute value:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;string&lt;/SPAN&gt;&lt;SPAN&gt; currentAttributeValue = _selectedFeature.Attributes[AttributeFieldName].ToString();&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 00:28:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112286#M10596</guid>
      <dc:creator>KoushikHajra</dc:creator>
      <dc:date>2021-10-29T00:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112614#M10608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/355965" target="_self"&gt;&lt;SPAN class=""&gt;KoushikHajra&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you for your valuable response.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I cannot able to get the object attributes using following code.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;currentAttributeValue = _selectedFeature.Attributes[AttributeFieldName].ToString();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I needs to get the&amp;nbsp; attributes values in WPF application, which is given by City Engine Object Attributes.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;see following figure&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26488i5A218F09B90B4822/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My code is below&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer();&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;foreach (var sl in MySceneView.Scene.OperationalLayers)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if (!string.IsNullOrEmpty(sl.Id))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;sceneLayer = (ArcGISSceneLayer)sl;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sceneLayer.ClearSelection();&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IdentifyLayerResult identifyResult = await MySceneView.IdentifyLayerAsync(sceneLayer, e.Position, 1, false, 1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IReadOnlyList&amp;lt;GeoElement&amp;gt; geoElements = identifyResult.GeoElements;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if (geoElements.Any())&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;GeoElement geoElement = geoElements.FirstOrDefault();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if (geoElement != null)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;sceneLayer.SelectFeature((Feature)geoElement);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;var _selectedFeature = (ArcGISFeature)identifyResult.GeoElements.First();&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;string currentAttributeValue = _selectedFeature.Attributes["City"].ToString();&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;above code raise the following exception&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;The given key 'City' was not present in the dictionary.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please give us advice&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 05:23:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112614#M10608</guid>
      <dc:creator>KarthikS</dc:creator>
      <dc:date>2021-10-30T05:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112626#M10609</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/1052" target="_self"&gt;&lt;SPAN class=""&gt;dotMorten&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you for your valuable response&lt;/P&gt;&lt;P&gt;the following example link is used to layer selection&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/wpf/sample-code/scene-layer-selection/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developers.arcgis.com/net/wpf/sample-code/scene-layer-selection/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But, &lt;STRONG&gt;I needs to get the object attributes , Which is given by the city engine object attributes in WPF application using ArcGIS Runtime SDK.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;see following figure&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="City Engine Scene" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26490i7548761D0C3372FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="City Engine Scene" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;City Engine Scene&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please give us advice&lt;/P&gt;&lt;P&gt;Thank You&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 09:40:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1112626#M10609</guid>
      <dc:creator>KarthikS</dc:creator>
      <dc:date>2021-10-30T09:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1121768#M10680</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Not sure if you were able to resolve your issue or not. Without looking at your data it's hard to tell what's going wrong. But I noticed one small thing in your code when you select. You already have a geoElement (&lt;EM&gt;sceneLayer.SelectFeature((Feature)geoElement);&lt;/EM&gt;) and you can try getting the attribute using the same object rather than trying to get it again?&lt;/P&gt;&lt;P&gt;In any case, if it hasn't resolved for you, it would help if you can share a small sample dataset and I can try it out on my end.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 17:50:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-object-attributes-at-runtime-using/m-p/1121768#M10680</guid>
      <dc:creator>KoushikHajra</dc:creator>
      <dc:date>2021-12-01T17:50:04Z</dc:date>
    </item>
  </channel>
</rss>

